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_ssh_password: q
|
||||
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:
|
||||
children:
|
||||
docker_servers:
|
||||
|
||||
@@ -42,6 +42,67 @@
|
||||
when:
|
||||
- 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
|
||||
ansible.builtin.apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
@@ -84,13 +145,10 @@
|
||||
# - docker-buildx-plugin
|
||||
# - docker-compose-plugin
|
||||
# update_cache: true
|
||||
|
||||
|
||||
- name: Install the version docker
|
||||
- name: Install the version docker1
|
||||
ansible.builtin.apt:
|
||||
name: "{{ item }}=5:28.5.2-1~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
allow_downgrade: true
|
||||
when:
|
||||
- ansible_distribution == "Debian"
|
||||
loop:
|
||||
@@ -98,7 +156,7 @@
|
||||
- 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 }}"
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
allow_downgrade: true
|
||||
when:
|
||||
@@ -108,7 +166,7 @@
|
||||
|
||||
- name: Install the version docker
|
||||
ansible.builtin.apt:
|
||||
name: "{{ item }}=0.28.0-0~{{ ansible_distribution | lower }}.{{ ansible_distribution_major_version }}~{{ ansible_distribution_release }}"
|
||||
name: "{{ item }}"
|
||||
state: present
|
||||
allow_downgrade: true
|
||||
when:
|
||||
@@ -116,6 +174,37 @@
|
||||
loop:
|
||||
- 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
|
||||
ansible.builtin.file:
|
||||
path: /etc/systemd/system/docker.service.d/
|
||||
|
||||
Reference in New Issue
Block a user