-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook2.yml
28 lines (28 loc) · 887 Bytes
/
playbook2.yml
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
28
---
- name: Install NGINX
hosts: all
become: yes
tasks:
- name: Install epel-release
yum: name=epel-release state=latest
- name: Install Nginx
yum: name=nginx
- name: Autostart webserver
service: name=nginx state=started enabled=yes
- name: Configuring Nginx 23uk-2
hosts: 23uk-2.devops.rebrain.srwx.net
become: yes
tasks:
- name: Generate nginx.conf
template: src=nginx/nginx2.j2 dest=/etc/nginx/nginx.conf mode=0644
notify: Reload nginx
- name: Create directory
file: path=/home/23uk-2.devops.rebrain.srwx.net state=directory
- name: Copy index.html
template: src=html/index.html dest=/home/23uk-2.devops.rebrain.srwx.net/index.html mode=0644
notify: Reload nginx
- name: Copy hostname2
template: src=hostname/hostname2 dest=/etc/hostname mode=0644
handlers:
- name: Reload nginx
service: name=nginx state=reloaded