--- - name: "[nginx] Place password-file: /etc/nginx/passwd/rest-server" copy: content: "{{ services.rest_server.nginx.password }}" dest: /etc/nginx/passwd/rest-server owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" mode: 0700 when: - services.rest_server.nginx.password is defined notify: "Restart nginx" - name: "[nginx] Create vhost" template: src: nginx-vhost.conf.j2 dest: /etc/nginx/conf.d/rest-server.conf mode: 0644 owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" notify: "Restart nginx"