fix ubuntu1804安装ex-lb失败问题

pull/746/head
gjmzj 2019-11-24 13:30:31 +00:00
parent 51b026e505
commit ecf1d28003
1 changed files with 17 additions and 16 deletions

View File

@ -19,22 +19,6 @@
- /etc/haproxy
- /etc/keepalived
- name: 安装 haproxy+keepalived
package: name={{ item }} state=present
with_items:
- haproxy
- keepalived
when: 'INSTALL_SOURCE != "offline"'
# 离线安装 haproxy+keepalived
- import_tasks: offline.yml
when: 'INSTALL_SOURCE == "offline"'
- name: 修改centos的haproxy.service
template: src=haproxy.service.j2 dest=/usr/lib/systemd/system/haproxy.service
when: 'ansible_distribution in ["CentOS","RedHat","Amazon"]'
tags: restart_lb
- name: 配置 haproxy
template: src=haproxy.cfg.j2 dest=/etc/haproxy/haproxy.cfg
tags: restart_lb
@ -49,6 +33,23 @@
when: LB_ROLE == "backup"
tags: restart_lb
- name: 安装 haproxy+keepalived
package: name={{ item }} state=present
with_items:
- haproxy
- keepalived
when: 'INSTALL_SOURCE != "offline"'
ignore_errors: true
# 离线安装 haproxy+keepalived
- import_tasks: offline.yml
when: 'INSTALL_SOURCE == "offline"'
- name: 修改centos的haproxy.service
template: src=haproxy.service.j2 dest=/usr/lib/systemd/system/haproxy.service
when: 'ansible_distribution in ["CentOS","RedHat","Amazon"]'
tags: restart_lb
- name: daemon-reload for haproxy.service
shell: systemctl daemon-reload
tags: restart_lb