mirror of https://github.com/easzlab/kubeasz.git
132 lines
4.8 KiB
YAML
132 lines
4.8 KiB
YAML
# 离线安装 haproxy
|
|
- 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"
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 haproxy_bionic 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/haproxy_bionic.tar.gz"
|
|
dest: "/opt/kube/packages/haproxy/haproxy_bionic.tar.gz"
|
|
|
|
- name: 安装 haproxy_bionic 离线包
|
|
shell: 'cd /opt/kube/packages/haproxy && tar zxf haproxy_bionic.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_haproxy.log 2>&1'
|
|
when: ansible_distribution_release == "bionic"
|
|
ignore_errors: true
|
|
|
|
- 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 && \
|
|
rpm -Uvh --force --nodeps *.rpm > /tmp/install_haproxy.log 2>&1'
|
|
when:
|
|
- 'ansible_distribution == "CentOS"'
|
|
- 'ansible_distribution_major_version == "7"'
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 haproxy_stretch 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/haproxy_stretch.tar.gz"
|
|
dest: "/opt/kube/packages/haproxy/haproxy_stretch.tar.gz"
|
|
|
|
- name: 安装 haproxy_stretch 离线包
|
|
shell: 'cd /opt/kube/packages/haproxy && tar zxf haproxy_stretch.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_haproxy.log 2>&1'
|
|
when: ansible_distribution_release == "stretch"
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 haproxy_buster 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/haproxy_buster.tar.gz"
|
|
dest: "/opt/kube/packages/haproxy/haproxy_buster.tar.gz"
|
|
|
|
- name: 安装 haproxy_buster 离线包
|
|
shell: 'cd /opt/kube/packages/haproxy && tar zxf haproxy_buster.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_haproxy.log 2>&1'
|
|
when: ansible_distribution_release == "buster"
|
|
ignore_errors: true
|
|
|
|
# 离线安装 keepalived
|
|
- name: 准备离线安装包目录
|
|
file: name=/opt/kube/packages/keepalived state=directory
|
|
|
|
- block:
|
|
- name: 分发 keepalived_xenial 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/keepalived_xenial.tar.gz"
|
|
dest: "/opt/kube/packages/keepalived/keepalived_xenial.tar.gz"
|
|
|
|
- name: 安装 keepalived_xenial 离线包
|
|
shell: 'cd /opt/kube/packages/keepalived && tar zxf keepalived_xenial.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_keepalived.log 2>&1'
|
|
when: ansible_distribution_release == "xenial"
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 keepalived_bionic 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/keepalived_bionic.tar.gz"
|
|
dest: "/opt/kube/packages/keepalived/keepalived_bionic.tar.gz"
|
|
|
|
- name: 安装 keepalived_bionic 离线包
|
|
shell: 'cd /opt/kube/packages/keepalived && tar zxf keepalived_bionic.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_keepalived.log 2>&1'
|
|
when: ansible_distribution_release == "bionic"
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 keepalived_centos7 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/keepalived_centos7.tar.gz"
|
|
dest: "/opt/kube/packages/keepalived/keepalived_centos7.tar.gz"
|
|
|
|
- name: 安装 keepalived_centos7 离线包
|
|
shell: 'cd /opt/kube/packages/keepalived && tar zxf keepalived_centos7.tar.gz && \
|
|
rpm -Uvh --force --nodeps *.rpm > /tmp/install_keepalived.log 2>&1'
|
|
when:
|
|
- 'ansible_distribution == "CentOS"'
|
|
- 'ansible_distribution_major_version == "7"'
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 keepalived_stretch 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/keepalived_stretch.tar.gz"
|
|
dest: "/opt/kube/packages/keepalived/keepalived_stretch.tar.gz"
|
|
|
|
- name: 安装 keepalived_stretch 离线包
|
|
shell: 'cd /opt/kube/packages/keepalived && tar zxf keepalived_stretch.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_keepalived.log 2>&1'
|
|
when: ansible_distribution_release == "stretch"
|
|
ignore_errors: true
|
|
|
|
- block:
|
|
- name: 分发 keepalived_buster 离线包
|
|
copy:
|
|
src: "{{ base_dir }}/down/packages/keepalived_buster.tar.gz"
|
|
dest: "/opt/kube/packages/keepalived/keepalived_buster.tar.gz"
|
|
|
|
- name: 安装 keepalived_buster 离线包
|
|
shell: 'cd /opt/kube/packages/keepalived && tar zxf keepalived_buster.tar.gz && \
|
|
dpkg -i *.deb > /tmp/install_keepalived.log 2>&1'
|
|
when: ansible_distribution_release == "buster"
|
|
ignore_errors: true
|