mirror of https://github.com/easzlab/kubeasz.git
minor changes in lb installing
parent
0e04736f2b
commit
c54f2293e6
|
@ -10,13 +10,8 @@
|
||||||
apt: update_cache=yes cache_valid_time=72000
|
apt: update_cache=yes cache_valid_time=72000
|
||||||
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
|
when: ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int >= 16
|
||||||
|
|
||||||
- name: apt安装 haproxy
|
- name: 安装 haproxy
|
||||||
apt: name=haproxy state=latest
|
package: 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配置目录
|
- name: 创建haproxy配置目录
|
||||||
file: name=/etc/haproxy state=directory
|
file: name=/etc/haproxy state=directory
|
||||||
|
@ -30,13 +25,8 @@
|
||||||
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
|
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
|
||||||
tags: restart_lb
|
tags: restart_lb
|
||||||
|
|
||||||
- name: apt安装 keepalived
|
- name: 安装 keepalived
|
||||||
apt: name=keepalived state=latest
|
package: 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配置目录
|
- name: 创建keepalived配置目录
|
||||||
file: name=/etc/keepalived state=directory
|
file: name=/etc/keepalived state=directory
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
global_defs {
|
global_defs {
|
||||||
router_id lb-master
|
router_id lb-master-{{ inventory_hostname }}
|
||||||
}
|
}
|
||||||
|
|
||||||
vrrp_script check-haproxy {
|
vrrp_script check-haproxy {
|
||||||
|
|
Loading…
Reference in New Issue