--- - name: Install packages apt: name: - nginx become: yes - name: Check for changed cert command: /bin/true when: - '{{ cert_changed | default(False) }}' notify: - restart nginx - name: Install nginx config template: src: nginx.conf.j2 dest: /etc/nginx/sites-available/default become: yes notify: - restart nginx