refactoring and cleanup
This commit is contained in:
parent
d016e27874
commit
7bfd83f83d
@ -1,4 +1,5 @@
|
||||
---
|
||||
- block:
|
||||
- name:
|
||||
yum_repository:
|
||||
name: nginx
|
||||
@ -35,14 +36,6 @@
|
||||
- /etc/nginx/sites-available
|
||||
- /etc/nginx/sites-enabled
|
||||
|
||||
- name: Add default page
|
||||
template:
|
||||
src: 'var/www/vhosts/default/index.html.j2'
|
||||
dest: '/var/www/vhosts/default/index.html'
|
||||
owner: nginx
|
||||
group: nginx
|
||||
mode: 0750
|
||||
|
||||
- name: Update nginx.conf
|
||||
template:
|
||||
src: 'etc/nginx/nginx.conf.j2'
|
||||
@ -91,6 +84,14 @@
|
||||
notify:
|
||||
- nginx_reload
|
||||
|
||||
- name: Open ports in iptables
|
||||
iptables_raw:
|
||||
name: allow_nginx_ports
|
||||
state: present
|
||||
rules: '-A INPUT -p tcp -m multiport --dports {{ nginx_open_ports|join(",") }} -j ACCEPT'
|
||||
become: True
|
||||
become_user: root
|
||||
|
||||
- block:
|
||||
- name: Copy tls certificate
|
||||
copy:
|
||||
@ -142,11 +143,16 @@
|
||||
become_user: root
|
||||
when: nginx_pfs_enabled
|
||||
|
||||
- name: Open ports in iptables
|
||||
iptables_raw:
|
||||
name: allow_nginx_ports
|
||||
state: present
|
||||
rules: '-A INPUT -p tcp -m multiport --dports {{ nginx_open_ports|join(",") }} -j ACCEPT'
|
||||
- block:
|
||||
- name: Add default page
|
||||
template:
|
||||
src: 'var/www/vhosts/default/index.html.j2'
|
||||
dest: '/var/www/vhosts/default/index.html'
|
||||
owner: nginx
|
||||
group: nginx
|
||||
mode: 0750
|
||||
become: True
|
||||
become_user: nginx
|
||||
|
||||
- name: Enable nginx service
|
||||
systemd:
|
||||
|
Loading…
Reference in New Issue
Block a user