2019-06-28 21:16:13 +08:00
|
|
|
# 离线安装 haproxy
|
2019-06-28 19:36:53 +08:00
|
|
|
- name: 准备离线安装包目录
|
|
|
|
file: name=/opt/kube/packages/haproxy state=directory
|
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: 分发 haproxy_xenial 离线包
|
|
|
|
copy:
|
|
|
|
src: "{{ base_dir }}/down/packages/haproxy_xenial.tar.gz"
|
|
|
|
dest: "/opt/kube/packages/haproxy/haproxy_xenial.tar.gz"
|
|
|
|
|
|
|
|
- name: 安装 haproxy_xenial 离线包
|
|
|
|
shell: 'cd /opt/kube/packages/haproxy && tar zxf haproxy_xenial.tar.gz && \
|
|
|
|
dpkg -i *.deb > /tmp/install_haproxy.log 2>&1'
|
|
|
|
when: ansible_distribution_release == "xenial"
|
2019-06-29 18:10:51 +08:00
|
|
|
ignore_errors: true
|
2019-06-28 19:36:53 +08:00
|
|
|
|
|
|
|
- block:
|
|
|
|
- name: 分发 haproxy_centos7 离线包
|
|
|
|
copy:
|
|
|
|
src: "{{ base_dir }}/down/packages/haproxy_centos7.tar.gz"
|
|
|
|
dest: "/opt/kube/packages/haproxy/haproxy_centos7.tar.gz"
|
|
|
|
|
|
|
|
- name: 安装 haproxy_centos7 离线包
|
|
|
|
shell: 'cd /opt/kube/packages/haproxy && tar zxf haproxy_centos7.tar.gz && \
|
2019-06-29 18:10:51 +08:00
|
|
|
rpm -Uvh --force --nodeps *.rpm > /tmp/install_haproxy.log 2>&1'
|
2019-06-28 19:36:53 +08:00
|
|
|
when:
|
|
|
|
- 'ansible_distribution == "CentOS"'
|
|
|
|
- 'ansible_distribution_major_version == "7"'
|
2019-06-29 18:10:51 +08:00
|
|
|
ignore_errors: true
|