I have a task that installs PHP and Perl modules against a group of servers. Servers w/ the word “batch” in their hostname run both Perl and PHP tasks (remove Perl tasks for simplicity). It seems the “Set PHP status success” task runs against machines w/ the word “batch” in them. ANy way I can skip it?
-
name: Install PHP modules
command: sudo rpm -Uvh {{ rpm_repository }}/{{ item.key }}-{{ item.value.svn_tag }}.rpm --force
with_dict: deploy_modules_php
register: php_command_result
when: “‘batch’ in ansible_hostname”
ignore_errors: True -
name: set PHP status fail
when: php_command_result|failed
set_fact:
color=“red”
msg=“Unable to install PHP RPMs!” -
name: Set PHP status success
when: php_command_result|success
set_fact:
color=“green”
msg=“Successfully installed PHP RPMs!”