mirror of
				https://github.com/geerlingguy/ansible-role-docker.git
				synced 2025-10-24 11:16:46 +02:00 
			
		
		
		
	molecule: add prepare playbook and bootstrap packages; guard apt repo for non-Debian
This commit is contained in:
		
							parent
							
								
									2ba74deefe
								
							
						
					
					
						commit
						c77727b122
					
				| @ -18,4 +18,5 @@ platforms: | ||||
| provisioner: | ||||
|   name: ansible | ||||
|   playbooks: | ||||
|     prepare: ${MOLECULE_PREPARE_PLAYBOOK:-prepare.yml} | ||||
|     converge: ${MOLECULE_PLAYBOOK:-converge.yml} | ||||
|  | ||||
							
								
								
									
										34
									
								
								molecule/default/prepare.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								molecule/default/prepare.yml
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| --- | ||||
| - name: Prepare | ||||
|   hosts: all | ||||
|   gather_facts: true | ||||
|   tasks: | ||||
|     - name: Install python3-apt for Debian/Ubuntu | ||||
|       apt: | ||||
|         name: python3-apt | ||||
|         state: present | ||||
|         update_cache: yes | ||||
|       when: ansible_facts.os_family == 'Debian' | ||||
| 
 | ||||
|     - name: Install common packages for RedHat family (best-effort) | ||||
|       block: | ||||
|         - name: Try to install python3-dnf | ||||
|           package: | ||||
|             name: python3-dnf | ||||
|             state: present | ||||
| 
 | ||||
|         - name: Try to install python3-libselinux | ||||
|           package: | ||||
|             name: python3-libselinux | ||||
|             state: present | ||||
|       when: ansible_facts.os_family == 'RedHat' | ||||
|       ignore_errors: true | ||||
| 
 | ||||
|     - name: Install packages for Suse family (best-effort) | ||||
|       block: | ||||
|         - name: Try to install python3-zypp | ||||
|           package: | ||||
|             name: python3-zypp | ||||
|             state: present | ||||
|       when: ansible_facts.os_family == 'Suse' | ||||
|       ignore_errors: true | ||||
| @ -104,7 +104,7 @@ | ||||
|     repo: >- | ||||
|       deb [arch={{ ansible_facts.architecture }}] | ||||
|       {{ docker_repo_url }}/{{ ansible_facts['distribution'] | lower }} | ||||
|       {{ ansible_facts['lsb']['codename'] }} {{ docker_apt_release_channel }} | ||||
|       {{ ansible_facts['lsb']['codename'] | default(ansible_facts.get('distribution_release', '')) }} | ||||
|     filename: "{{ docker_apt_filename }}" | ||||
|     state: present | ||||
|   when: docker_add_repo | bool | ||||
|   when: docker_add_repo | bool and ansible_facts.os_family == 'Debian' | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user