I am trying to install Apache2 with Ansible. I have a role and handler for Apache.
My playbook ( site.yml) contains:
---
- hosts: webservers
remote_user: ansrun
become: true
become_method: sudo
Ansible role file contains:
- name: Install Apache 2
apt: name={{ item }} update_cache=yes state=present
with_items:
- apache2
when: ansible_distribution == "Ubuntu"
- name: Enable mod_rewrite
apache2_module: name=rewrite state=present
notify:
- reload apache2
Whenever I start the playbook, I get this message, but nothing has changed.
changed: [10.0.1.200] => (item=[u'apache2'])
I think this has something to do with the conditional.
source
share