Добавлена роль с установкой докера и настройкой зеркал (#10)

Co-authored-by: Fedor Batonogov <f.batonogov@yandex.ru>
This commit is contained in:
github-actions[bot]
2024-05-31 08:54:22 +03:00
committed by GitHub
parent a327438868
commit 51fd58adbb
7 changed files with 62 additions and 1 deletions

7
ansible/docker.yaml Normal file
View File

@@ -0,0 +1,7 @@
---
- name: Развертывание docker
become: true
hosts:
- test_hosts
roles:
- docker_install

View File

@@ -19,3 +19,11 @@ kubeadm:
vars:
ansible_user: infra
ansible_port: 22
test_hosts:
hosts:
kubeadm-cp-01:
ansible_host: 10.0.75.203
vars:
ansible_user: infra
ansible_port: 22

View File

@@ -0,0 +1,7 @@
{
"registry-mirrors": [
"https://dockerhub.timeweb.cloud",
"https://mirror.gcr.io",
"https://public.ecr.aws"
]
}

View File

@@ -0,0 +1,7 @@
---
- name: Перезапускаю docker.service
ansible.builtin.systemd:
name: docker.service
state: restarted
enabled: true
daemon_reload: true

View File

@@ -0,0 +1,5 @@
---
# tasks file for docker-install
- name: Install Docker on Ubuntu
ansible.builtin.import_tasks: ubuntu.yml
when: ansible_distribution == 'Ubuntu'

View File

@@ -0,0 +1,27 @@
---
- name: Добавляю ключ Docker GPG
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
keyring: /etc/apt/trusted.gpg.d/docker.gpg
- name: Добавляю репозиторий Docker
ansible.builtin.apt_repository:
repo: deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
state: present
filename: docker
- name: Устанавливаю нужные пакеты
ansible.builtin.apt:
name:
- docker-ce
state: present
update_cache: true
- name: Наливаю daemon.json
ansible.builtin.copy:
src: daemon.json
dest: /etc/docker/daemon.json
mode: '644'
notify:
- Перезапускаю docker.service

View File

@@ -1,6 +1,6 @@
variable "vm_count" {
description = "Number of VMs to create"
default = 2
default = 1
}
resource "proxmox_virtual_environment_vm" "vm" {