|
@ -1,46 +1,43 @@ |
|
|
--- |
|
|
--- |
|
|
|
|
|
|
|
|
|
|
|
- name: Update apt cache |
|
|
|
|
|
apt: |
|
|
|
|
|
update_cache: yes |
|
|
|
|
|
cache_valid_time: "{{ aptcachetime }}" |
|
|
|
|
|
|
|
|
|
|
|
- name: Upgrade all apt packages |
|
|
|
|
|
apt: upgrade=dist |
|
|
|
|
|
|
|
|
- name: Install docker packages |
|
|
- name: Install docker packages |
|
|
apt: |
|
|
apt: |
|
|
name: "{{ item }}" |
|
|
name: "{{ item }}" |
|
|
state: present |
|
|
state: present |
|
|
update_cache: yes |
|
|
update_cache: yes |
|
|
with_items: |
|
|
|
|
|
- apt-transport-https |
|
|
|
|
|
- ca-certificates |
|
|
|
|
|
- curl |
|
|
|
|
|
- gnupg-agent |
|
|
|
|
|
- software-properties-common |
|
|
|
|
|
|
|
|
|
|
|
- name: Add Docker s official GPG key |
|
|
|
|
|
remote_user: ubuntu |
|
|
|
|
|
|
|
|
cache_valid_time: "{{ aptcachetime }}" |
|
|
|
|
|
loop: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common'] |
|
|
|
|
|
|
|
|
|
|
|
- name: Add Docker GPG key |
|
|
apt_key: |
|
|
apt_key: |
|
|
url: https://download.docker.com/linux/ubuntu/gpg |
|
|
url: https://download.docker.com/linux/ubuntu/gpg |
|
|
state: present |
|
|
state: present |
|
|
|
|
|
|
|
|
- name: Verify that we have the key with the fingerprint |
|
|
- name: Verify that we have the key with the fingerprint |
|
|
remote_user: ubuntu |
|
|
|
|
|
apt_key: |
|
|
apt_key: |
|
|
id: 0EBFCD88 |
|
|
id: 0EBFCD88 |
|
|
state: present |
|
|
state: present |
|
|
|
|
|
|
|
|
- name: Add deb repository |
|
|
- name: Add deb repository |
|
|
apt_repository: |
|
|
apt_repository: |
|
|
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable |
|
|
|
|
|
|
|
|
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ lsb_release }} stable |
|
|
state: present |
|
|
state: present |
|
|
update_cache: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Update apt packages |
|
|
|
|
|
remote_user: ubuntu |
|
|
|
|
|
apt: |
|
|
|
|
|
update_cache: yes |
|
|
|
|
|
|
|
|
|
|
|
- name: Install docker |
|
|
- name: Install docker |
|
|
remote_user: ubuntu |
|
|
|
|
|
apt: |
|
|
apt: |
|
|
name: docker-ce |
|
|
|
|
|
|
|
|
name: "{{ item }}" |
|
|
state: present |
|
|
state: present |
|
|
update_cache: yes |
|
|
update_cache: yes |
|
|
|
|
|
cache_valid_time: "{{ aptcachetime }}" |
|
|
|
|
|
loop: ['docker-ce', 'docker-ce-cli', 'containerd.io'] |
|
|
|
|
|
|
|
|
- name: Create Docker group |
|
|
- name: Create Docker group |
|
|
group: name=docker state=present |
|
|
group: name=docker state=present |
|
@ -57,3 +54,6 @@ |
|
|
dest: /usr/local/bin/docker-compose |
|
|
dest: /usr/local/bin/docker-compose |
|
|
force: no |
|
|
force: no |
|
|
mode: 0755 |
|
|
mode: 0755 |
|
|
|
|
|
|
|
|
|
|
|
- name: Upgrade installed packages |
|
|
|
|
|
apt: upgrade=yes |