- name: be sure nginx is installed apt: name: nginx - name: be sure the nginx config file is present copy: src: ../files/nginx.conf dest: /etc/nginx/nginx.conf - name: be sure nginx site config files are present template: src: sites/{{ item }}.conf.j2 dest: /etc/nginx/sites-enabled/{{ item }}.conf with_items: - ki notify: - "nginx config changed" - name: be sure nginx sites are not present file: state: absent path: "/etc/nginx/sites-enabled/{{ item }}" with_items: - default notify: - "nginx config changed"