new file
This commit is contained in:
81
playbooks/setup-docker.yaml
Normal file
81
playbooks/setup-docker.yaml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
- name: Install package on Debian 13.x
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- apt-transport-https
|
||||||
|
- ca-certificates
|
||||||
|
- curl
|
||||||
|
- gnupg2
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian"
|
||||||
|
- ansible_distribution_version is version('13', '>=')
|
||||||
|
|
||||||
|
- name: Setup Docker reposoitory
|
||||||
|
ansible.builtin.deb822_repository:
|
||||||
|
name: docker
|
||||||
|
types: [deb]
|
||||||
|
uris: "https://download.docker.com/linux/debian"
|
||||||
|
components: [stable]
|
||||||
|
suites: ["trixie"]
|
||||||
|
signed_by: https://download.docker.com/linux/debian/gpg
|
||||||
|
state: present
|
||||||
|
enabled: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian"
|
||||||
|
- ansible_distribution_version is version('13', '>=')
|
||||||
|
|
||||||
|
- name: Install Docker Engine Debian 12.x
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io=1.7.28-1*
|
||||||
|
- docker-compose-plugin
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
allow_downgrade: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian"
|
||||||
|
- ansible_distribution_version is version('13', '<')
|
||||||
|
|
||||||
|
- name: Install Docker Engine Debian 13.x
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- containerd.io=1.7.28-1*
|
||||||
|
- docker-compose-plugin
|
||||||
|
state: present
|
||||||
|
update_cache: yes
|
||||||
|
allow_downgrade: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian"
|
||||||
|
- ansible_distribution_version is version('13', '>=')
|
||||||
|
|
||||||
|
- name: Hold containerd.io package
|
||||||
|
ansible.builtin.dpkg_selections:
|
||||||
|
name: containerd.io
|
||||||
|
selection: hold
|
||||||
|
|
||||||
|
- name: Create docker user
|
||||||
|
user:
|
||||||
|
name: docker
|
||||||
|
uid: 2000
|
||||||
|
group: docker
|
||||||
|
state: present
|
||||||
|
create_home: yes
|
||||||
|
home: /home/docker
|
||||||
|
shell: /bin/bash
|
||||||
|
|
||||||
|
- name: Add key for docker user
|
||||||
|
ansible.posix.authorized_key:
|
||||||
|
user: docker
|
||||||
|
state: present
|
||||||
|
key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIjMDDhinpnCPFUMERa/tLYymzRI8oJoAvXZnBH9wpA4 fake@gmail.com"
|
||||||
|
|
||||||
|
- name: Start Docker service
|
||||||
|
systemd:
|
||||||
|
name: docker
|
||||||
|
state: started
|
||||||
|
enabled: yes
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
import_tasks: ./upgrade-packages.yaml
|
import_tasks: ./upgrade-packages.yaml
|
||||||
|
|
||||||
- name: Install-docker.yml - setting up docker
|
- name: Install-docker.yml - setting up docker
|
||||||
import_tasks: ./install-docker.yaml
|
import_tasks: ./setup-docker.yaml
|
||||||
|
|
||||||
- name: Setup-netbird.yml - setting up netbird mesh vpn
|
- name: Setup-netbird.yml - setting up netbird mesh vpn
|
||||||
import_tasks: ./setup-netbird.yaml
|
import_tasks: ./setup-netbird.yaml
|
||||||
|
|||||||
Reference in New Issue
Block a user