Commit 7b7dfae4 authored by nanahira's avatar nanahira

don't do yum things when python3

parent bd40b869
Pipeline #2866 passed with stage
in 6 minutes and 25 seconds
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
yum: yum:
name: docker-ce,docker-ce-cli,containerd.io name: docker-ce,docker-ce-cli,containerd.io
update_cache: yes update_cache: yes
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 and ansible_python.version.major == 2
notify: restart_docker notify: restart_docker
- name: 安装 Docker (dnf) - name: 安装 Docker (dnf)
become: true become: true
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
when: ansible_os_family == 'Debian' when: ansible_os_family == 'Debian'
- name: yum - name: yum
include_tasks: yum.yml include_tasks: yum.yml
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 and ansible_python.version.major == 2
- name: dnf - name: dnf
include_tasks: dnf.yml include_tasks: dnf.yml
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 8
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
name: '*' name: '*'
update_cache: true update_cache: true
state: latest state: latest
when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 when: ansible_os_family == 'RedHat' and ansible_distribution_major_version|int == 7 and ansible_python.version.major == 2
- name: dnf update - name: dnf update
become: true become: true
dnf: dnf:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment