How to find a match using regex in ansible playbook where variable appears in the regex_search
argument?
The following playbook doesn't find the match... when run using: ansible-playbook playbook.yml
- hosts: localhost
gather_facts: no
tasks:
- set_fact:
pattern: "{{ 'foobar' | regex_search('foo') }}"
- set_fact:
m: "{{ 'beefoo' | regex_search('bee{{ pattern }}') }}"
- debug:
msg: "hi {{ m }}"
bee
in'^' + pattern | string
? – Waive