mirror of
				https://gitea.0xace.cc/ansible-galaxy/docker.git
				synced 2025-11-04 03:27:25 +00:00 
			
		
		
		
	use ansible_facts
This commit is contained in:
		@@ -1,2 +1,2 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
docker_version: "20.10.9-3.el{{ansible_distribution_major_version}}"
 | 
					docker_version: "20.10.9-3.el{{ansible_facts['distribution_major_version']}}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,21 +30,21 @@
 | 
				
			|||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
    enablerepo: extras
 | 
					    enablerepo: extras
 | 
				
			||||||
  when:
 | 
					  when:
 | 
				
			||||||
    - ansible_os_family == 'RedHat'
 | 
					    - ansible_facts['os_family'] == 'RedHat'
 | 
				
			||||||
    - ansible_distribution_major_version <= '7'
 | 
					    - ansible_facts['distribution_major_version'] <= '7'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Add Epel repo 
 | 
					- name: Add Epel repo 
 | 
				
			||||||
  yum:
 | 
					  yum:
 | 
				
			||||||
    name: epel-release
 | 
					    name: epel-release
 | 
				
			||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
  when:
 | 
					  when:
 | 
				
			||||||
    - ansible_os_family == 'RedHat'
 | 
					    - ansible_facts['os_family'] == 'RedHat'
 | 
				
			||||||
    - ansible_distribution_major_version == '8'
 | 
					    - ansible_facts['distribution_major_version'] == '8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: Ensure python3-docker installed
 | 
					- name: Ensure python3-docker installed
 | 
				
			||||||
  yum:
 | 
					  yum:
 | 
				
			||||||
    name: python3-docker
 | 
					    name: python3-docker
 | 
				
			||||||
    state: present
 | 
					    state: present
 | 
				
			||||||
  when:
 | 
					  when:
 | 
				
			||||||
    - ansible_os_family == 'RedHat'
 | 
					    - ansible_facts['os_family'] == 'RedHat'
 | 
				
			||||||
    - ansible_distribution_major_version == '8'
 | 
					    - ansible_facts['distribution_major_version'] == '8'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,3 +1,3 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
- name: Include docker install
 | 
					- name: Include docker install
 | 
				
			||||||
  include_tasks: "{{ ansible_os_family }}.yaml"
 | 
					  include_tasks: "{{ ansible_facts['os_family'] }}.yaml"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user