From 1e66e7e6ef9149224db0f4b953c4e98d1df99647 Mon Sep 17 00:00:00 2001 From: gj19910723 <517109928@qq.com> Date: Fri, 26 Jul 2019 12:58:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=96=B0=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E5=90=8E=E6=8E=A8=E9=80=8107.cluster-addon.yml=E7=9A=84?= =?UTF-8?q?=E9=95=9C=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/02.addnode.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/02.addnode.yml b/tools/02.addnode.yml index 4e705b3cb..b2e58a481 100644 --- a/tools/02.addnode.yml +++ b/tools/02.addnode.yml @@ -13,14 +13,22 @@ - { role: flannel, when: "CLUSTER_NETWORK == 'flannel'" } - { role: kube-router, when: "CLUSTER_NETWORK == 'kube-router'" } - { role: kube-ovn, when: "CLUSTER_NETWORK == 'kube-ovn'" } - post_tasks: - - name: 推送所有离线镜像包 - copy: src={{ base_dir }}/down/ dest=/opt/kube/images/ - - name: 导入所有离线镜像 + tasks: + - name: 创建文件夹/opt/kube/images + file: dest=/opt/kube/images state=directory + - name: 推送07.cluster-addon.yml中的镜像包 + copy: src={{ item }} dest=/opt/kube/images/ + with_fileglob: + - "{{ base_dir }}/down/coredns*.tar" + - "{{ base_dir }}/down/dashboard*.tar" + - "{{ base_dir }}/down/heapster*.tar" + - "{{ base_dir }}/down/metrics*.tar" + - "{{ base_dir }}/down/traefik*.tar" + - name: 导入离线镜像(若执行失败,可忽略) shell: ls /opt/kube/images/*.tar |while read n;do {{ bin_dir }}/docker load -i $n ;done ignore_errors: true when: "CONTAINER_RUNTIME == 'docker'" - - name: 导入所有离线镜像 + - name: 导入离线镜像(若执行失败,可忽略) shell: ls /opt/kube/images/*.tar |while read n;do {{ bin_dir }}/ctr -n=k8s.io images import $n ;done ignore_errors: true when: "CONTAINER_RUNTIME == 'containerd'"