--- - name: Install nginx yum: name: nginx - name: enable nginx ignore_errors: yes systemd: name: nginx enabled: yes state: started - name: Set httpd_can_network_connect flag on and keep it persistent across reboots seboolean: name: httpd_can_network_connect state: yes persistent: yes - name: create /etc/nginx/nginx.conf from template template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf owner: root group: root mode: '0644' notify: Restart nginx - name: Allow apache to read files in /etc/letsencrypt/{{ letsEncryptDomain }} sefcontext: target: '/etc/letsencrypt/{{ letsEncryptDomain }}(/.*)?' setype: httpd_sys_content_t state: present notify: - Restore selinux context - name: create certificate directory file: path: /etc/letsencrypt/{{ letsEncryptDomain }} state: directory - name: create static dir file: path: /home/beieli/mini-beieli-web/static state: directory - name: 502 error page copy: src: 502.html dest: /home/beieli/mini-beieli-web/static/502.html - name: copy css files copy: src: "{{ item }}" dest: "/home/beieli/mini-beieli-web/static/{{ item }}" loop: - mini-beieli-web.css - mini-beieli-web-custom.css