--- - name: adding user nginx to group acme-redirect user: name: "{{ services.nginx.user | default('http') }}" groups: acme-redirect append: yes when: - services.acme_redirect.enable is true - name: "Remove file: /etc/nginx/conf.d/default.conf" file: path: /etc/nginx/conf.d/default.conf state: absent - name: Download dh-params from mozilla to /etc/nginx/dhparam get_url: url: https://ssl-config.mozilla.org/ffdhe2048.txt dest: /etc/nginx/dhparam owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" notify: "Restart nginx" - name: "Create file: /etc/nginx/nginx.conf" template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" notify: "Restart nginx" - name: "Create file: /etc/nginx/ssl.conf" copy: src: ssl_settings.conf dest: /etc/nginx/ssl.conf owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" notify: "Restart nginx" - name: "Create file: /etc/nginx/proxy.conf" copy: src: proxy_settings.conf dest: /etc/nginx/proxy.conf owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" mode: 0755 notify: "Restart nginx" - name: "Create file: /etc/nginx/php_fastcgi_params" copy: src: php_fastcgi_params dest: /etc/nginx/php_fastcgi_params owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" mode: 0755 notify: "Restart nginx" - name: "Create directory: /etc/nginx/passwd" file: path: /etc/nginx/passwd state: directory owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}" mode: 0700 - name: "Create directory: /etc/nginx/conf.d" file: path: /etc/nginx/conf.d state: directory owner: "{{ services.nginx.user | default('http') }}" group: "{{ services.nginx.group | default('http') }}"