- name: Enable http://box/awstats via NGINX, by installing {{ nginx_conf_dir }}/awstats-nginx.conf from template template: src: awstats-nginx.conf dest: "{{ nginx_conf_dir }}/" # /etc/nginx/conf.d when: awstats_enabled | bool - name: Disable http://box/awstats via NGINX, by removing {{ nginx_conf_dir }}/awstats-nginx.conf file: path: "{{ nginx_conf_dir }}/awstats-nginx.conf" # /etc/nginx/conf.d state: absent when: not awstats_enabled - name: Restart 'nginx' systemd service systemd: name: nginx state: restarted