diff --git a/ansible/roles/docker-compose/files/elementweb/.env b/ansible/roles/elementweb/files/basedir/.env similarity index 100% rename from ansible/roles/docker-compose/files/elementweb/.env rename to ansible/roles/elementweb/files/basedir/.env diff --git a/ansible/roles/docker-compose/files/elementweb/config.json b/ansible/roles/elementweb/files/basedir/config.json similarity index 100% rename from ansible/roles/docker-compose/files/elementweb/config.json rename to ansible/roles/elementweb/files/basedir/config.json diff --git a/ansible/roles/elementweb/tasks/main.yml b/ansible/roles/elementweb/tasks/main.yml new file mode 100644 index 0000000..87cfaf0 --- /dev/null +++ b/ansible/roles/elementweb/tasks/main.yml @@ -0,0 +1,27 @@ +- name: Copy docker-compose contents + ansible.builtin.copy: + src: files/basedir/{{ item }}/ + dest: /home/{{ ansible_user }}/docker_compose/{{ docker_compose }} + owner: "{{ ansible_user }}" + mode: '0644' + tags: + - files + - test + +- name: Create nginx dir + ansible.builtin.file: + path: /home/{{ ansible_user }}/docker_compose/nginx + state: directory + owner: "{{ ansible_user }}" + mode: '0755' + tags: + - dir + +- name: Create nginx config + ansible.builtin.template: + src: "nginx/elementweb.conf" + dest: /home/{{ ansible_user }}/docker_compose/nginx/elementweb.conf + owner: "{{ ansible_user }}" + mode: '0644' + tags: + - test diff --git a/ansible/roles/docker-compose/files/elementweb/nginx/elementweb.conf b/ansible/roles/elementweb/templates/nginx/elementweb.conf similarity index 68% rename from ansible/roles/docker-compose/files/elementweb/nginx/elementweb.conf rename to ansible/roles/elementweb/templates/nginx/elementweb.conf index 2370b4d..c1923d3 100644 --- a/ansible/roles/docker-compose/files/elementweb/nginx/elementweb.conf +++ b/ansible/roles/elementweb/templates/nginx/elementweb.conf @@ -6,6 +6,11 @@ server { ssl_certificate /ssl/chain.crt; ssl_certificate_key /ssl/certificate.keyplain; + access_log /var/log/nginx/element/access-{{ inventory_hostname }}.log main; + access_log /var/log/nginx/access-{{ inventory_hostname }}.log main; + error_log /var/log/nginx/element/error-{{ inventory_hostname }}.log notice; + error_log /var/log/nginx/error-{{ inventory_hostname }}.log notice; + error_page 403 404 /403_404.html; location = /403_404.html { default_type application/json;