-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.yaml
27 lines (21 loc) · 990 Bytes
/
nginx.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
# install and setup nginx to serve index.html below on http://localhost:8080
- hosts: all
sudo: True
tasks:
# our installation varies based on the target machine, this will handle
# apt (Debian/Ubuntu) and yum (Red Hat/CentOS) installs
- include: ./tasks/debian.yaml
when_string: $ansible_distribution == 'Debian' or $ansible_distribution == 'Ubuntu'
- include: ./tasks/rhel.yaml
when_string: $ansible_distribution == 'CentOS' or $ansible_distribution == 'Red Hat'
- name: create /usr/share/nginx/puppet
file: path=/usr/share/nginx/puppet state=directory
- name: copy index.html to /usr/share/nginx/puppet
copy: backup=yes src=./files/index.html dest=/usr/share/nginx/puppet/index.html
- name: copy nginx configuration to /etc/nginx/nginx.conf
copy: backup=yes src=./files/nginx.conf dest=/etc/nginx/nginx.conf
notify: restart nginx
handlers:
- name: restart nginx
command: /etc/init.d/nginx restart