diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-12-21 13:25:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-01-02 08:52:03 +0100 |
commit | 1f3564a99e21af5bd4ac4d11fa3ec7c3885e5208 (patch) | |
tree | 255291d12eb6f025694f2bb1fb8717612d2b6e7b /ansible/roles/nginx | |
parent | 1cd44b1fb602fee7f844764f866ce19311279b88 (diff) | |
download | infra-1f3564a99e21af5bd4ac4d11fa3ec7c3885e5208.tar.gz infra-1f3564a99e21af5bd4ac4d11fa3ec7c3885e5208.tar.bz2 infra-1f3564a99e21af5bd4ac4d11fa3ec7c3885e5208.tar.xz infra-1f3564a99e21af5bd4ac4d11fa3ec7c3885e5208.zip |
minio
Diffstat (limited to 'ansible/roles/nginx')
-rw-r--r-- | ansible/roles/nginx/defaults/main.yml | 2 | ||||
-rw-r--r-- | ansible/roles/nginx/handlers/main.yml | 11 | ||||
-rw-r--r-- | ansible/roles/nginx/tasks/main.yml | 32 |
3 files changed, 45 insertions, 0 deletions
diff --git a/ansible/roles/nginx/defaults/main.yml b/ansible/roles/nginx/defaults/main.yml new file mode 100644 index 0000000..fe42c1b --- /dev/null +++ b/ansible/roles/nginx/defaults/main.yml @@ -0,0 +1,2 @@ +nginx__copy: +nginx__template: diff --git a/ansible/roles/nginx/handlers/main.yml b/ansible/roles/nginx/handlers/main.yml new file mode 100644 index 0000000..039e72b --- /dev/null +++ b/ansible/roles/nginx/handlers/main.yml @@ -0,0 +1,11 @@ +- name: systemctl reload nginx + become: yes + systemd: + name: nginx + state: reloaded + +- name: systemctl restart nginx + become: yes + systemd: + name: nginx + state: restarted diff --git a/ansible/roles/nginx/tasks/main.yml b/ansible/roles/nginx/tasks/main.yml new file mode 100644 index 0000000..bbe6da7 --- /dev/null +++ b/ansible/roles/nginx/tasks/main.yml @@ -0,0 +1,32 @@ +- become: yes + tags: + - nginx + block: + - name: packages + vars: + items: + - nginx + apt: + name: "{{ items }}" + install_recommends: no + +- become: yes + tags: + - nginx + - nginx-config + block: + - name: "fill /etc/nginx" + with_items: "{{ nginx__copy }}" + when: item is defined and item + notify: systemctl reload nginx + copy: + dest: "/etc/nginx/{{ item }}" + src: "nginx/{{ ansible_hostname }}/{{ item }}" + + - name: "fill /etc/nginx" + with_items: "{{ nginx__template }}" + when: item is defined and item + notify: systemctl reload nginx + template: + dest: "/etc/nginx/{{ item }}" + src: "nginx/{{ ansible_hostname }}/{{ item }}" |