diff options
Diffstat (limited to 'ansible/roles')
-rw-r--r-- | ansible/roles/minio-server/tasks/main.yml | 1 | ||||
-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 |
4 files changed, 46 insertions, 0 deletions
diff --git a/ansible/roles/minio-server/tasks/main.yml b/ansible/roles/minio-server/tasks/main.yml index f2df91d..b94b00a 100644 --- a/ansible/roles/minio-server/tasks/main.yml +++ b/ansible/roles/minio-server/tasks/main.yml @@ -35,6 +35,7 @@ name: "{{ user }}" group: "{{ group }}" system: yes + shell: /bin/bash - file: path: "{{ item }}" 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 }}" |