mirror of
https://gitlab.sectorq.eu/jaydee/ansible.git
synced 2025-12-14 01:54:56 +01:00
build
This commit is contained in:
@@ -107,7 +107,19 @@ datacenter:
|
|||||||
ansible_become_password: q
|
ansible_become_password: q
|
||||||
# ansible_ssh_password: q
|
# ansible_ssh_password: q
|
||||||
ansible_ssh_private_key_file: ssh_key.pem
|
ansible_ssh_private_key_file: ssh_key.pem
|
||||||
|
proxmox:
|
||||||
|
children:
|
||||||
|
docker_workers:
|
||||||
|
children:
|
||||||
|
worker1:
|
||||||
|
hosts:
|
||||||
|
192.168.77.184:
|
||||||
|
vars:
|
||||||
|
ansible_ssh_user: jd
|
||||||
|
ansible_become_user: root
|
||||||
|
ansible_become_password: q
|
||||||
|
# ansible_ssh_password: q
|
||||||
|
ansible_ssh_password: q
|
||||||
containers:
|
containers:
|
||||||
children:
|
children:
|
||||||
docker_servers:
|
docker_servers:
|
||||||
|
|||||||
@@ -42,6 +42,67 @@
|
|||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian" and ansible_distribution_major_version == "12"
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "12"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Ensure docker keyring directory exists
|
||||||
|
file:
|
||||||
|
path: /etc/apt/keyrings
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
|
||||||
|
- name: Download Docker GPG key
|
||||||
|
get_url:
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
dest: /etc/apt/keyrings/docker.asc
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "13"
|
||||||
|
|
||||||
|
- name: Install docker.sources file
|
||||||
|
template:
|
||||||
|
src: docker.sources.j2
|
||||||
|
dest: /etc/apt/sources.list.d/docker.sources
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "13"
|
||||||
|
|
||||||
|
- name: Create docker.sources file
|
||||||
|
copy:
|
||||||
|
dest: /etc/apt/sources.list.d/docker.sources
|
||||||
|
mode: "0644"
|
||||||
|
content: |
|
||||||
|
Types: deb
|
||||||
|
URIs: https://download.docker.com/linux/debian
|
||||||
|
Suites: {{ ansible_facts['lsb']['codename'] }}
|
||||||
|
Components: stable
|
||||||
|
Signed-By: /etc/apt/keyrings/docker.asc
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "13"
|
||||||
|
|
||||||
|
|
||||||
|
- name: Update apt cache
|
||||||
|
apt:
|
||||||
|
update_cache: yes
|
||||||
|
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "13"
|
||||||
|
|
||||||
|
- name: Download Docker GPG key
|
||||||
|
get_url:
|
||||||
|
url: https://download.docker.com/linux/debian/gpg
|
||||||
|
dest: /etc/apt/keyrings/docker.asc
|
||||||
|
mode: "0644"
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian" and ansible_distribution_major_version == "13"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- name: Add an Apt signing key to a specific keyring file
|
- name: Add an Apt signing key to a specific keyring file
|
||||||
ansible.builtin.apt_key:
|
ansible.builtin.apt_key:
|
||||||
url: https://download.docker.com/linux/ubuntu/gpg
|
url: https://download.docker.com/linux/ubuntu/gpg
|
||||||
@@ -84,13 +145,10 @@
|
|||||||
# - docker-buildx-plugin
|
# - docker-buildx-plugin
|
||||||
# - docker-compose-plugin
|
# - docker-compose-plugin
|
||||||
# update_cache: true
|
# update_cache: true
|
||||||
|
- name: Install the version docker1
|
||||||
|
|
||||||
- name: Install the version docker
|
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ item }}=5:28.5.2-1~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
allow_downgrade: true
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
loop:
|
loop:
|
||||||
@@ -98,7 +156,7 @@
|
|||||||
- docker-ce-cli
|
- docker-ce-cli
|
||||||
- name: Install the version docker
|
- name: Install the version docker
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ item }}=1.7.28-2~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
allow_downgrade: true
|
allow_downgrade: true
|
||||||
when:
|
when:
|
||||||
@@ -108,13 +166,44 @@
|
|||||||
|
|
||||||
- name: Install the version docker
|
- name: Install the version docker
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
name: "{{ item }}=0.28.0-0~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
name: "{{ item }}"
|
||||||
state: present
|
state: present
|
||||||
allow_downgrade: true
|
allow_downgrade: true
|
||||||
when:
|
when:
|
||||||
- ansible_distribution == "Debian"
|
- ansible_distribution == "Debian"
|
||||||
loop:
|
loop:
|
||||||
- docker-buildx-plugin
|
- docker-buildx-plugin
|
||||||
|
|
||||||
|
|
||||||
|
- name: Install the version docker
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "{{ item }}=5:28.5.2-1~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
||||||
|
state: present
|
||||||
|
allow_downgrade: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian1"
|
||||||
|
loop:
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- name: Install the version docker
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "{{ item }}=1.7.28-2~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
||||||
|
state: present
|
||||||
|
allow_downgrade: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian1"
|
||||||
|
loop:
|
||||||
|
- containerd.io
|
||||||
|
|
||||||
|
- name: Install the version docker
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "{{ item }}=0.28.0-0~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
||||||
|
state: present
|
||||||
|
allow_downgrade: true
|
||||||
|
when:
|
||||||
|
- ansible_distribution == "Debian1"
|
||||||
|
loop:
|
||||||
|
- docker-buildx-plugin
|
||||||
|
|
||||||
- name: Create a directory docker.service.d
|
- name: Create a directory docker.service.d
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
|
|||||||
Reference in New Issue
Block a user