Add docker role
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
Torjus Håkestad 2022-01-13 01:16:33 +01:00
parent 8eee022005
commit da57e58a3d
7 changed files with 153 additions and 0 deletions

View File

@ -7,6 +7,7 @@
- hosts: all
roles:
- common
- docker
- hosts: docker2.t-juice.club
roles:

Binary file not shown.

View File

@ -0,0 +1,82 @@
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-stable-debuginfo]
name=Docker CE Stable - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-stable-source]
name=Docker CE Stable - Sources
baseurl=https://download.docker.com/linux/centos/7/source/stable
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-edge]
name=Docker CE Edge - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-edge-debuginfo]
name=Docker CE Edge - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-edge-source] [1/6021]name=Docker CE Edge - Sources
baseurl=https://download.docker.com/linux/centos/7/source/edge
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-test]
name=Docker CE Test - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-test-debuginfo]
name=Docker CE Test - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-test-source]
name=Docker CE Test - Sources
baseurl=https://download.docker.com/linux/centos/7/source/test
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-nightly]
name=Docker CE Nightly - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-nightly-debuginfo]
name=Docker CE Nightly - Debuginfo $basearch
baseurl=https://download.docker.com/linux/centos/7/debug-$basearch/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
[docker-ce-nightly-source]
name=Docker CE Nightly - Sources
baseurl=https://download.docker.com/linux/centos/7/source/nightly
enabled=0
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg

View File

@ -0,0 +1 @@
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bullseye stable

View File

@ -0,0 +1,14 @@
---
- name: Install debian packages
import_tasks: packages_debian.yml
when: ansible_facts['os_family'] == 'Debian'
- name: Install rhel packages
import_tasks: packages_redhat.yml
when: ansible_facts['os_family'] == 'RedHat'
- name: Ensure service is started and enabled
ansible.builtin.systemd:
name: docker
state: started
enabled: yes

View File

@ -0,0 +1,29 @@
---
- name: Remove unwanted packages
ansible.builtin.apt:
name:
- docker
- docker-engine
- docker.io
- containerd
- runc
state: absent
- name: Add docker repo signing key
ansible.builtin.copy:
src: docker-archive-keyring.gpg
dest: /usr/share/keyrings/docker-archive-keyring.gpg
- name: Add docker repo
ansible.builtin.copy:
src: docker.list
dest: /etc/apt/sources.list.d/docker.list
- name: Install docker packages
ansible.builtin.apt:
name:
- docker-ce-cli
- docker-ce-rootless-extras
- docker-ce
- docker-scan-plugin
state: present

View File

@ -0,0 +1,26 @@
---
- name: Remove unwanted packages
ansible.builtin.yum:
name:
- docker
- docker-client
- docker-client-latest
- docker-common
- docker-latest
- docker-latest-logrotate
- docker-logrotate
- docker-engine
state: absent
- name: Add repo
ansible.builtin.copy:
src: docker-ce.repo
dest: /etc/yum.repos.d/docker-ce.repo
- name: Install packages
ansible.builtin.yum:
name:
- docker-ce
- docker-ce-cli
- docker-ce-rootless-extras
- docker-scan-plugin