Compare commits
	
		
			3 Commits
		
	
	
		
			c60666509f
			...
			d31f4039cd
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					d31f4039cd | ||
| 
						 | 
					b145665190 | ||
| 
						 | 
					7b5d7354e5 | 
							
								
								
									
										20
									
								
								tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								tasks/main.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- name: Ensure prerequisite packages are installed
 | 
			
		||||
  include_tasks: prereqs.yaml
 | 
			
		||||
 | 
			
		||||
- name: Install apt repository
 | 
			
		||||
  include_tasks: repo.yaml
 | 
			
		||||
 | 
			
		||||
- name: Install the latest docker-ce packages
 | 
			
		||||
  ansible.builtin.apt:
 | 
			
		||||
    name: "{{ item }}"
 | 
			
		||||
    state: latest
 | 
			
		||||
    update_cache: yes
 | 
			
		||||
  with_items:
 | 
			
		||||
    - docker-ce
 | 
			
		||||
    - docker-ce-cli
 | 
			
		||||
    - containerd.io
 | 
			
		||||
    - docker-compose-plugin
 | 
			
		||||
  notify:
 | 
			
		||||
    - Restart Docker daemon
 | 
			
		||||
							
								
								
									
										12
									
								
								tasks/prereqs.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								tasks/prereqs.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- name: Ensure prerequisite packages are installed
 | 
			
		||||
  ansible.builtin.apt:
 | 
			
		||||
    name: "{{ item }}"
 | 
			
		||||
    state: latest
 | 
			
		||||
    update_cache: yes
 | 
			
		||||
  with_items:
 | 
			
		||||
    - ca-certificates
 | 
			
		||||
    - curl
 | 
			
		||||
    - gnupg
 | 
			
		||||
    - lsb-release
 | 
			
		||||
							
								
								
									
										33
									
								
								tasks/repo.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								tasks/repo.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,33 @@
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
- name: Ensure apt keyrings directory exists
 | 
			
		||||
  ansible.builtin.file:
 | 
			
		||||
    path: /etc/apt/keyrings
 | 
			
		||||
    state: directory
 | 
			
		||||
    mode: 0755
 | 
			
		||||
    group: root
 | 
			
		||||
    owner: root
 | 
			
		||||
 | 
			
		||||
- name: Download the Docker key
 | 
			
		||||
  ansible.builtin.shell:
 | 
			
		||||
    cmd: curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
 | 
			
		||||
    creates: /etc/apt/keyrings/docker.gpg
 | 
			
		||||
  args:
 | 
			
		||||
    warn: no
 | 
			
		||||
  register: cmd_output
 | 
			
		||||
 | 
			
		||||
    #- name: Debug key download
 | 
			
		||||
    #  ansible.builtin.debug:
 | 
			
		||||
    #    var: cmd_output
 | 
			
		||||
 | 
			
		||||
- name: Create the repository file
 | 
			
		||||
  ansible.builtin.shell:
 | 
			
		||||
    cmd: echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
 | 
			
		||||
    creates: /etc/apt/sources.list.d/docker.list
 | 
			
		||||
  args:
 | 
			
		||||
    warn: no
 | 
			
		||||
  register: cmd_output
 | 
			
		||||
 | 
			
		||||
    #- name: Debug repo file
 | 
			
		||||
    #  ansible.builtin.debug:
 | 
			
		||||
    #    var: cmd_output
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user