From dfa86bf1846c0b870a256a28ea16124f6de1082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E9=9B=A8=E5=A3=B0?= <212724256@qq.com> Date: Thu, 17 Nov 2022 16:40:51 +0800 Subject: [PATCH 1/3] Update variables.yml fix: update npd_versioon to npd_version --- variables.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/variables.yml b/variables.yml index 9fe82ef..bb04060 100644 --- a/variables.yml +++ b/variables.yml @@ -4,7 +4,7 @@ runc_version: "v1.1" pause_version: "{% if kube_version is version('v1.22.0', '<=') %}3.2{% else %}3.5{% endif %}" busybox_version: "1.28" cni_version: "v0.8.6" -npd_versioon: "v0.8.1" +npd_version: "v0.8.1" # ----------------------- 容器镜像地址 --------------------- # coredns @@ -49,7 +49,7 @@ rook_csi_attacher_image: "{{ dns_repository_hostname }}:{{ registry_port }}/kube # metrics-server image metrics_server_image: "{{ dns_repository_hostname }}:{{ registry_port }}/kubeoperator/metrics-server:{{ metrics_server_version }}" # npd image 地址 -npd_image: "{{ dns_repository_hostname }}:{{ registry_port }}/kubeoperator/node-problem-detector:{{ npd_versioon }}" +npd_image: "{{ dns_repository_hostname }}:{{ registry_port }}/kubeoperator/node-problem-detector:{{ npd_version }}" # helm2 tiller image tiller_image: "{{ dns_repository_hostname }}:{{ registry_port }}/kubeoperator/tiller:{{ helm_v2_version }}" # huawei-csi @@ -149,4 +149,4 @@ helm3_download_url: "{{ registry_protocol }}://{{ dns_repository_hostname }}:{{ chrony_download_url: "{{ registry_protocol }}://{{ dns_repository_hostname }}:{{ repo_port }}/repository/oss-proxy/chrony/{{ architectures }}/chrony_xenial.tar.gz" # ----------------------- 集群名称样式(ip,hostname) -------------------- -cluster_name_style: "{% if hostvars[inventory_hostname]['ansible_ssh_host'] is defined %}hostname{% else %}ip{% endif %}" \ No newline at end of file +cluster_name_style: "{% if hostvars[inventory_hostname]['ansible_ssh_host'] is defined %}hostname{% else %}ip{% endif %}" From 58060e102c6d75bf079625a56843b2bf7b26a98e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=81=E9=9B=A8=E5=A3=B0?= <212724256@qq.com> Date: Fri, 18 Nov 2022 09:33:18 +0800 Subject: [PATCH 2/3] clean yum cache feat: clean yum cache --- roles/prepare/repository/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/prepare/repository/tasks/main.yml b/roles/prepare/repository/tasks/main.yml index 8461953..7284529 100644 --- a/roles/prepare/repository/tasks/main.yml +++ b/roles/prepare/repository/tasks/main.yml @@ -6,8 +6,8 @@ path: /etc/yum.repos.d/bak state: directory - - name: Backup the old repository - shell: "sudo mv -f /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak >/dev/null 2>&1 || sudo ls /etc/yum.repos.d/ >/dev/null 2>&1" + - name: Backup the old repository and clean yum cache + shell: "sudo mv -f /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak >/dev/null 2>&1 || sudo ls /etc/yum.repos.d/ >/dev/null 2>&1 || yum clean all >/dev/null 2>&1 || rm -rf /var/cache/yum/* 2>&1" - name: Remove other repository file: From bcf57142139eca1e1ac0959d5b976c8f2d146eda Mon Sep 17 00:00:00 2001 From: vpc123 <212724256@qq.com> Date: Sun, 18 Dec 2022 08:37:52 +0800 Subject: [PATCH 3/3] fix: use && execute ansible shell --- roles/prepare/repository/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/prepare/repository/tasks/main.yml b/roles/prepare/repository/tasks/main.yml index 7284529..0ee7ebf 100644 --- a/roles/prepare/repository/tasks/main.yml +++ b/roles/prepare/repository/tasks/main.yml @@ -7,7 +7,7 @@ state: directory - name: Backup the old repository and clean yum cache - shell: "sudo mv -f /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak >/dev/null 2>&1 || sudo ls /etc/yum.repos.d/ >/dev/null 2>&1 || yum clean all >/dev/null 2>&1 || rm -rf /var/cache/yum/* 2>&1" + shell: "sudo mv -f /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak >/dev/null 2>&1 && yum clean all >/dev/null 2>&1 && rm -rf /var/cache/yum/* 2>&1 || sudo ls /etc/yum.repos.d/ >/dev/null 2>&1" - name: Remove other repository file: