-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaproxy_pb.yml
68 lines (61 loc) · 1.42 KB
/
haproxy_pb.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
- hosts: backend_servers
vars_prompt:
- name: file_name
private: no
prompt: "Enter the WebApp file name"
tasks:
- name: installing httpd
package:
name: httpd
state: present
- name: installing php
package:
name: php
state: present
- template:
dest: "/var/www/html/{{ file_name }}.php"
content: |
<pre>
<?php
print `/usr/sbin/ifconfig`;
?>
</pre>
notify: restart httpd
handlers:
- name: restart httpd
service:
name: httpd
state: started
- hosts: load_balancer
vars_prompt:
- name: port_fs
prompt: "port of front end server "
private: no
- name: port_bs
prompt: "port of backend servers "
private: no
tasks:
- name: installing haproxy
package:
name: haproxy
state: present
- name: installing httpd
package:
name: httpd
state: present
- name: updating the port of protocol
template:
dest: "/etc/haproxy/haproxy.cfg"
src: "/ws1/haproxy.cfg.j2"
notify:
- restart haproxy
- restart httpd
handlers:
- name: restart haproxy
service:
name: haproxy
state: restarted
- name: restart httpd
service:
name: httpd
state: restarted