nginx: add support for Debian distros
This commit is contained in:
parent
e3862a5be6
commit
446e6132c7
|
@ -1,3 +1,15 @@
|
|||
- name: Set configuration parameters for Alpine
|
||||
when: ansible_os_family == 'Alpine'
|
||||
set_fact:
|
||||
nginx_user: nginx
|
||||
nginx_default_site: /etc/nginx/http.d/default.conf
|
||||
|
||||
- name: Set configuration parameters for Debian
|
||||
when: ansible_os_family == 'Debian'
|
||||
set_fact:
|
||||
nginx_user: www-data
|
||||
nginx_default_site: /etc/nginx/sites-available/default
|
||||
|
||||
- name: Install packages
|
||||
package:
|
||||
name:
|
||||
|
@ -9,13 +21,13 @@
|
|||
path: /srv/http/.well-known
|
||||
recurse: true
|
||||
state: directory
|
||||
owner: nginx
|
||||
group: nginx
|
||||
owner: "{{ nginx_user }}"
|
||||
group: "{{ nginx_user }}"
|
||||
|
||||
- name: Set up default HTTP server
|
||||
copy:
|
||||
dest: /etc/nginx/http.d
|
||||
src: default.conf
|
||||
dest: "{{ nginx_default_site }}"
|
||||
notify: reload nginx
|
||||
|
||||
- name: Enable nginx service
|
||||
|
@ -24,6 +36,8 @@
|
|||
enabled: true
|
||||
state: started
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: Get LE certificate
|
||||
command:
|
||||
cmd: >
|
||||
|
|
Loading…
Reference in a new issue