Ansible.Harbor/roles/dockerhost/tasks/main.yml
Danny Bessems 2ee5dd308d
Some checks reported errors
continuous-integration/drone/push Build encountered an error
Unpin docker versions
2022-08-30 09:10:27 +02:00

76 lines
1.9 KiB
YAML

- name: Remove undesired packages
apt:
name:
- containerd
- docker
- docker-engine
- docker.io
- runc
- snapd
state: absent
autoremove: yes
purge: yes
- name: Install prereqs for custom apt repository over https
apt:
update_cache: yes
name:
- apt-transport-https
- ca-certificates
- curl
- gnupg-agent
- software-properties-common
state: present
- name: Add Docker repo key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present
- name: Determine Ubuntu distribution name
command: lsb_release -cs
register: releasename
- name: Add Docker apt repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ releasename.stdout }} stable
state: present
# # Pinning versions due to odd DNS issue in 20.x
# - name: Pin Docker engine to specific version
# copy:
# dest: "{{ item.dest }}"
# content: "{{ item.content }}"
# with_items:
# - dest: /etc/apt/preferences.d/docker-ce
# content: |
# Package: docker-ce
# Pin: version 5:19.03.13~3-0~ubuntu-{{ releasename.stdout }}
# Pin-Priority: 1001
# - dest: /etc/apt/preferences.d/docker-ce-cli
# content: |
# Package: docker-ce-cli
# Pin: version 5:19.03.13~3-0~ubuntu-{{ releasename.stdout }}
# Pin-Priority: 1001
- name: Install Docker engine
apt:
update_cache: yes
allow_unauthenticated: yes
name:
- docker-ce
- docker-ce-cli
- containerd.io
- name: Install Docker Compose
get_url:
url: https://github.com/docker/compose/releases/download/1.27.4/docker-compose-Linux-x86_64
dest: /usr/local/bin/docker-compose
mode: '0755'
- name: Add Docker Compose to path
command: ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
args:
creates: /usr/bin/docker-compose