Hi,
I have for an example an task which enables modules in apache2 in debian with the command a2enmod.
So I have:
- name: Debian | Apache | Enable Basic Mods
command: a2enmod {{ item }}
with_items: - rewrite
- ssl
when: “ansible_os_family == ‘Debian’”
tags: apache
notify: - restart apache2
Now I don’t wan’t to get apache restarted every single time, only if it really enabled an module. I can handle such a task as failed with:
register: command_result
failed_when: "'Enabling module' in command_result.stderr"
I would need that but for success not for failing.
Is this possible?
thanks