mirror of
				https://gitea.0xace.cc/ansible-galaxy/docker.git
				synced 2025-11-04 03:27:25 +00:00 
			
		
		
		
	add docker-ce role
This commit is contained in:
		
							
								
								
									
										2
									
								
								defaults/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								defaults/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					docker_version: "20.10.9-3.el{{ansible_distribution_major_version}}"
 | 
				
			||||||
							
								
								
									
										0
									
								
								meta/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								meta/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
								
								
									
										50
									
								
								tasks/centos.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										50
									
								
								tasks/centos.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,50 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Add Docker CE Stable repo
 | 
				
			||||||
 | 
					  yum_repository:
 | 
				
			||||||
 | 
					    name: "docker-ce-stable"
 | 
				
			||||||
 | 
					    description: "Docker CE Stable - $basearch"
 | 
				
			||||||
 | 
					    file: docker-ce
 | 
				
			||||||
 | 
					    baseurl: "https://download.docker.com/linux/centos/$releasever/$basearch/stable"
 | 
				
			||||||
 | 
					    enabled: no
 | 
				
			||||||
 | 
					    gpgcheck: yes
 | 
				
			||||||
 | 
					    gpgkey: "https://download.docker.com/linux/centos/gpg"
 | 
				
			||||||
 | 
					    async: yes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Ensure docker version {{ docker_version }} installed
 | 
				
			||||||
 | 
					  yum:
 | 
				
			||||||
 | 
					    name: "docker-ce-{{ docker_version }}"
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					    enablerepo: "docker-ce-stable"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Ensure docker service enabled and started
 | 
				
			||||||
 | 
					  systemd:
 | 
				
			||||||
 | 
					    name: docker
 | 
				
			||||||
 | 
					    enabled: yes
 | 
				
			||||||
 | 
					    state: started
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Ensure python-docker-py installed
 | 
				
			||||||
 | 
					  yum:
 | 
				
			||||||
 | 
					    name: python-docker-py
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					    enablerepo: extras
 | 
				
			||||||
 | 
					  when:
 | 
				
			||||||
 | 
					    - ansible_os_family == 'RedHat'
 | 
				
			||||||
 | 
					    - ansible_distribution_major_version <= '7'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Add Epel repo 
 | 
				
			||||||
 | 
					  yum:
 | 
				
			||||||
 | 
					    name: epel-release
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					  when:
 | 
				
			||||||
 | 
					    - ansible_os_family == 'RedHat'
 | 
				
			||||||
 | 
					    - ansible_distribution_major_version == '8'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- name: Ensure python3-docker installed
 | 
				
			||||||
 | 
					  yum:
 | 
				
			||||||
 | 
					    name: python3-docker
 | 
				
			||||||
 | 
					    state: present
 | 
				
			||||||
 | 
					  when:
 | 
				
			||||||
 | 
					    - ansible_os_family == 'RedHat'
 | 
				
			||||||
 | 
					    - ansible_distribution_major_version == '8'
 | 
				
			||||||
							
								
								
									
										4
									
								
								tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								tasks/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
				
			|||||||
 | 
					---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- include_tasks: centos.yml
 | 
				
			||||||
 | 
					  when: ansible_os_family == 'RedHat'
 | 
				
			||||||
		Reference in New Issue
	
	Block a user