add sites-enabled and sites-available
This commit is contained in:
parent
1e273cf654
commit
425559a095
@ -5,7 +5,7 @@
|
|||||||
enabled: yes
|
enabled: yes
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
- name: Prepare directories
|
- name: Prepare vhost directories
|
||||||
file:
|
file:
|
||||||
path: '{{ item }}'
|
path: '{{ item }}'
|
||||||
state: directory
|
state: directory
|
||||||
@ -16,6 +16,17 @@
|
|||||||
- /var/www/vhosts
|
- /var/www/vhosts
|
||||||
- /var/www/vhosts/default
|
- /var/www/vhosts/default
|
||||||
|
|
||||||
|
- name: Prepare nginx directories
|
||||||
|
file:
|
||||||
|
path: '{{ item }}'
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0640
|
||||||
|
with_items:
|
||||||
|
- /etc/nginx/sites-available
|
||||||
|
- /etc/nginx/sites-enabled
|
||||||
|
|
||||||
- name: Add default page
|
- name: Add default page
|
||||||
template:
|
template:
|
||||||
src: 'var/www/vhosts/default/index.html.j2'
|
src: 'var/www/vhosts/default/index.html.j2'
|
||||||
@ -42,11 +53,28 @@
|
|||||||
group: root
|
group: root
|
||||||
mode: 0640
|
mode: 0640
|
||||||
with_items:
|
with_items:
|
||||||
- default.conf
|
|
||||||
- header.conf
|
- header.conf
|
||||||
notify:
|
notify:
|
||||||
- nginx_restart
|
- nginx_restart
|
||||||
|
|
||||||
|
- name: Add default page config
|
||||||
|
template:
|
||||||
|
src: 'etc/nginx/conf.d/sites-available/default.j2'
|
||||||
|
dest: '/etc/nginx/conf.d/sites-available/default'
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0640
|
||||||
|
|
||||||
|
- name: Enable default page
|
||||||
|
file:
|
||||||
|
src: /etc/nginx/sites-available/default
|
||||||
|
dest: /etc/nginx/sites-enabled/default
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
state: link
|
||||||
|
notify:
|
||||||
|
- nginx_restart
|
||||||
|
|
||||||
- name: Open ports in iptables
|
- name: Open ports in iptables
|
||||||
iptables_raw:
|
iptables_raw:
|
||||||
name: allow_nginx_ports
|
name: allow_nginx_ports
|
||||||
|
Loading…
Reference in New Issue
Block a user