支持debian9离线安装基础软件

pull/644/head
gjmzj 2019-07-16 23:26:29 +08:00
parent e12c1f1c2a
commit 5ec23d69c0
3 changed files with 53 additions and 0 deletions

View File

@ -40,6 +40,18 @@
- '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
# 离线安装 keepalived
- name: 准备离线安装包目录
file: name=/opt/kube/packages/keepalived state=directory
@ -81,3 +93,15 @@
- '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

View File

@ -39,3 +39,15 @@
- '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

View File

@ -49,3 +49,20 @@
- 'ansible_distribution == "CentOS"'
- 'ansible_distribution_major_version == "7"'
ignore_errors: true
- block:
- name: 分发 basic_stretch 离线包
copy:
src: "{{ base_dir }}/down/packages/basic_stretch.tar.gz"
dest: "/opt/kube/packages/basic/basic_stretch.tar.gz"
# 离线安装包可能需要安装多次才能成功
- name: 安装 basic_stretch 离线包
shell: 'cd /opt/kube/packages/basic && tar zxf basic_stretch.tar.gz && \
dpkg -i *.deb > /tmp/install_basic.log 2>&1'
register: install_info
until: not install_info.failed
retries: 3
delay: 1
when: ansible_distribution_release == "stretch"
ignore_errors: true