- name: be sure nginx is installed apt: name: nginx - name: be sure the nginx files are present copy: src: "../files/{{ item }}" dest: "/etc/nginx/{{ item }}" with_items: - nginx.conf - kipasswd - 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"