Finding A String Within An Stdout_lines Array
I am trying to find whether a certain letter exists in an stdout_lines array. I want the role to run if there is a 'P' found in the stdout_output. The stdout_lines array looks lik
Solution 1:
The error message is strange and I can not reproduce it in Ansible 2. But your condition still will not work, a list does not have a find method. In Ansible you can search a list with in
:
roles:
- all_servers
- {role: production_server, when: '"P" in prod_fact'}
Post a Comment for "Finding A String Within An Stdout_lines Array"