GHP publish
This commit is contained in:
39
roles/nginx/tasks/configure.yml
Normal file
39
roles/nginx/tasks/configure.yml
Normal file
@ -0,0 +1,39 @@
|
||||
---
|
||||
- block:
|
||||
- name: configure nginx.conf
|
||||
copy:
|
||||
content: "{{ nginx['nginx.conf'] }}"
|
||||
dest: "/etc/nginx/nginx.conf"
|
||||
notify: reload nginx
|
||||
when: nginx['nginx.conf'] is defined
|
||||
|
||||
- name: add configs nginx to conf.d
|
||||
copy:
|
||||
content: "{{ item.data }}"
|
||||
dest: "/etc/nginx/conf.d/{{ item.name }}"
|
||||
loop: "{{ nginx['conf.d'] }}"
|
||||
notify: reload nginx
|
||||
when: nginx['conf.d'] is defined
|
||||
|
||||
- name: add configs nginx to stream.d
|
||||
copy:
|
||||
content: "{{ item.data }}"
|
||||
dest: "/etc/nginx/stream.d/{{ item.name }}"
|
||||
loop: "{{ nginx['stream.d'] }}"
|
||||
notify: reload nginx
|
||||
when: nginx['stream.d'] is defined
|
||||
|
||||
- name: check if ssl dir exist
|
||||
file: path=/etc/nginx/ssl state=directory
|
||||
when: nginx.ssl is defined
|
||||
|
||||
- name: add ssl certs and keys
|
||||
copy:
|
||||
content: "{{ item.data }}"
|
||||
dest: "/etc/nginx/ssl/{{ item.name }}"
|
||||
loop: "{{ nginx.ssl }}"
|
||||
notify: reload nginx
|
||||
when: nginx.ssl is defined
|
||||
|
||||
tags:
|
||||
- nginx-configure
|
11
roles/nginx/tasks/install.yml
Normal file
11
roles/nginx/tasks/install.yml
Normal file
@ -0,0 +1,11 @@
|
||||
---
|
||||
- block:
|
||||
- name: installing nginx
|
||||
package:
|
||||
name:
|
||||
- nginx
|
||||
state: present
|
||||
notify: start nginx
|
||||
register: install_nginx_result
|
||||
tags:
|
||||
- nginx-install
|
8
roles/nginx/tasks/main.yml
Normal file
8
roles/nginx/tasks/main.yml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
- block:
|
||||
- import_tasks: install.yml
|
||||
- import_tasks: configure.yml
|
||||
|
||||
become: true
|
||||
tags:
|
||||
- nginx
|
Reference in New Issue
Block a user