-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.yml
47 lines (40 loc) · 1.05 KB
/
setup.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
- hosts: Web_Server
tasks:
- name: "Installling Apache "
package:
name: httpd,php
state: present
- name: "Copying Web Pages"
template:
src: "/Arth-task-12/index.php"
dest: "/var/www/html/index.php"
register: web
- name: "Strating Web Server"
service:
name: httpd
state: started
- name: "Restarting Web Serer After Configuration"
service:
name: httpd
state: restarted
when: web.changed == True
- hosts: Load_Balancer
tasks:
- name: "Installing and Configuring Load Balancer"
package:
name: haproxy
state: present
- name: "Configuring HAPROXY"
template:
src: /Arth-task-12/haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
register: x
- name: "Starting Haproxy"
service:
name: haproxy
state: started
- name: "Started Haproxy with new configuration"
service:
name: haproxy
state: restarted
when: x.changed == True