From eb89ecce10c6795ec8d2be2a0337e893aba76097 Mon Sep 17 00:00:00 2001 From: Ryan Toler Date: Mon, 2 Mar 2026 07:47:59 +0000 Subject: [PATCH] new file --- playbooks/setup-docker.yaml | 81 +++++++++++++++++++++++++++++++++++++ playbooks/setup-lxc.yaml | 2 +- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 playbooks/setup-docker.yaml diff --git a/playbooks/setup-docker.yaml b/playbooks/setup-docker.yaml new file mode 100644 index 0000000..de1f845 --- /dev/null +++ b/playbooks/setup-docker.yaml @@ -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 \ No newline at end of file diff --git a/playbooks/setup-lxc.yaml b/playbooks/setup-lxc.yaml index 62e732e..f3c8b9b 100644 --- a/playbooks/setup-lxc.yaml +++ b/playbooks/setup-lxc.yaml @@ -11,7 +11,7 @@ import_tasks: ./upgrade-packages.yaml - 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 import_tasks: ./setup-netbird.yaml