minor changes in lb installing

pull/453/head
gjmzj 2019-02-07 15:23:59 +08:00
parent 0e04736f2b
commit c54f2293e6
2 changed files with 5 additions and 15 deletions

View File

@ -10,13 +10,8 @@
apt: update_cache=yes cache_valid_time=72000
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
- name: apt安装 haproxy
apt: name=haproxy state=latest
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
- name: yum安装 haproxy
yum: name=haproxy state=latest
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
- name: 安装 haproxy
package: name=haproxy state=latest
- name: 创建haproxy配置目录
file: name=/etc/haproxy state=directory
@ -30,13 +25,8 @@
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
tags: restart_lb
- name: apt安装 keepalived
apt: name=keepalived state=latest
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
- name: yum安装 keepalived
yum: name=keepalived state=latest
when: (ansible_distribution == "CentOS" or ansible_distribution == "RedHat") and ansible_distribution_major_version == "7"
- name: 安装 keepalived
package: name=keepalived state=latest
- name: 创建keepalived配置目录
file: name=/etc/keepalived state=directory

View File

@ -1,5 +1,5 @@
global_defs {
router_id lb-master
router_id lb-master-{{ inventory_hostname }}
}
vrrp_script check-haproxy {