Hi All,
I am trying to run a playbook where when I entre standard ansible modules
using regular expressions it works fine ( Thanks to Todd for helping me
with it), however when I entre a Linux command in place of an ansible
module it does not work as expected. An suggestion or guidance to make it
would be of great help to resolve my issue.
The playbook is:- ( I have highlighted the command that I wish to execute )
+++
---
- hosts: all
gather_facts: True
become: false
tasks:
- name: show file contents
debug:
msg: "{{ lookup('file', 'customer-expects.txt') }}"
- name: Correct kernel?
set_fact:
# These dashes matter.
expectation: |-
{%- if lookup('file', 'customer-expects.txt')
is regex([*'shell:"cat /etc/redhat-release"*']|join('
')|regex_escape()) -%}
matched
{%- else -%}
missed
{%- endif -%}
Thanks,
Marian
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/b550f4ef-1a01-4750-aa36-46eb0b84e1cbn%40googlegroups.com.