-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaproxy.yml
executable file
·31 lines (31 loc) · 915 Bytes
/
haproxy.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
---
- hosts: kavin
sudo: yes
tasks:
- name: install httpd
yum: name=httpd update_cache=yes state=latest
- name: enabled mod_rewrite
apache2_module: name=rewrite state=present
- name: ensure apache is running
service: name=httpd state=running enabled=yes
- name: stop apache
service: name=httpd state=stopped
- name: Copy the index.html
copy:
src: /root/playbooks/index.html
dest: /var/www/html
- name: start apache
service: name=httpd state=started
- hosts: haproxy
tasks:
- name: install haproxy
yum: name=haproxy state=present
- name: Update HAProxy config
copy:
src: /root/playbooks/templates/haproxy.cfg
dest: /etc/haproxy/haproxy.cfg
backup: yes
- name: stop haproxy
service: name=haproxy state=stopped
- name: start haproxy
service: name=haproxy state=started