refactoring and cleanup

This commit is contained in:
Robert Kaussow 2017-12-23 12:30:23 +01:00
parent d016e27874
commit 7bfd83f83d

View File

@ -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: