--- - hosts: "{{ nginx_host }}" gather_facts: no vars: template_path: "/srv/ansible/fqz/nginx_template" nginx_conf_path: "/usr/local/nginx/conf/en-sites" tasks: - name: "publish nginx conf file" template: src: "{{ template_path }}/{{ lang }}.conf.j2" dest: "{{ nginx_conf_path }}/{{ domain }}.conf" force: "{% if nginxforce == 'true' %} yes {% else %} no {% endif %}" - name: "nginx check" shell: "export PATH=$PATH:/srv/bin;nginx -t" - name: "nginx reload" shell: "export PATH=$PATH:/srv/bin;nginx -s reload"