diff --git a/roles/containerd/tasks/main.yml b/roles/containerd/tasks/main.yml index b809331..b76a326 100644 --- a/roles/containerd/tasks/main.yml +++ b/roles/containerd/tasks/main.yml @@ -1,11 +1,11 @@ - name: 获取是否已经安装docker - shell: 'systemctl is-active docker || echo "NOT FOUND"' + shell: 'systemctl is-active docker || echo "NoFound"' register: docker_status - name: WARNNING 提示 debug: msg: "[WARN]: docker is running, and containerd will be installed" - when: '"active" in docker_status.stdout' + when: '"NoFound" not in docker_status.stdout' - name: 获取是否已经安装containerd shell: 'systemctl is-active containerd || echo "NoFound"' @@ -66,4 +66,4 @@ state: present regexp: 'crictl completion' line: 'source <(crictl completion)' - when: "'active' not in containerd_svc.stdout" + when: "'NoFound' in containerd_svc.stdout" diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 7e3fe6a..f9e96e1 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -113,7 +113,7 @@ - name: 配置 docker 命令软链接 file: src={{ bin_dir }}/docker dest=/usr/bin/docker state=link ignore_errors: true - when: "'active' not in containerd_svc.stdout and 'active' not in docker_svc.stdout" + when: "'NoFound' in containerd_svc.stdout and 'NoFound' in docker_svc.stdout" ## 可选 ------安装docker查询镜像 tag的小工具---- - name: 下载 docker-tag diff --git a/roles/prepare/tasks/main.yml b/roles/prepare/tasks/main.yml index 65f0768..e909017 100644 --- a/roles/prepare/tasks/main.yml +++ b/roles/prepare/tasks/main.yml @@ -1,10 +1,10 @@ # 系统基础软件环境 -- name: apt更新缓存刷新 - apt: update_cache=yes cache_valid_time=72000 - ignore_errors: true - when: - - 'ansible_distribution in ["Ubuntu","Debian"]' - - 'INSTALL_SOURCE != "offline"' +#- name: apt更新缓存刷新 +# apt: update_cache=yes cache_valid_time=72000 +# ignore_errors: true +# when: +# - 'ansible_distribution in ["Ubuntu","Debian"]' +# - 'INSTALL_SOURCE != "offline"' - import_tasks: ubuntu.yml when: 'ansible_distribution in ["Ubuntu","Debian"]'