Code:
- name: Httpd running ?
shell: ps axo args | grep httpd | grep -v grep
register: apache
failed_when: false
ignore_errors: yes <---- if this removed I get red error on non httpd servers
- name: Copy script
get_url:
url: "http://anotherscript.sh
dest: /tmp/anotherscript.sh
mode: 0755
owner: root
group: root
force: yes
when: apache.rc == 0
What I want is
Code:
when apache.rc == 0
do url; dest; mode; owner etc
done
when apache.rc != 0
next
If I put " ignore_errors: yes " then it ignore apache.rc and do every thing(url, dest, mod etc) on a given server regardless it has httpd running or not.
If I remove " ignore_errors: yes " then it starts bringing red font errors on all the servers where httpd is not running.
Please help.