2023-07-21 00:36:14 +00:00
|
|
|
---
|
|
|
|
- name: Update web servers
|
|
|
|
hosts: all
|
|
|
|
remote_user: root
|
|
|
|
tasks:
|
|
|
|
- name: Install a list of packages
|
|
|
|
ansible.builtin.apt:
|
|
|
|
pkg:
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- gnupg
|
2023-07-21 01:07:17 +00:00
|
|
|
|
2023-07-21 01:05:43 +00:00
|
|
|
- name: Add an Apt signing key, uses whichever key is at the URL
|
|
|
|
ansible.builtin.apt_key:
|
|
|
|
url: https://download.docker.com/linux/debian/gpg
|
|
|
|
state: present
|
|
|
|
|
2023-07-21 00:36:14 +00:00
|
|
|
- name: Add docker repository
|
2023-07-21 00:37:38 +00:00
|
|
|
ansible.builtin.apt_repository:
|
2023-07-21 01:05:43 +00:00
|
|
|
repo: "deb [arch=amd64] https://download.docker.com/linux/debian {{ ansible_distribution_release }} stable"
|
2023-07-21 00:37:38 +00:00
|
|
|
state: present
|
2023-07-21 00:36:14 +00:00
|
|
|
|
|
|
|
- name: Install a list of packages
|
|
|
|
ansible.builtin.apt:
|
|
|
|
update_cache: yes
|
|
|
|
pkg:
|
|
|
|
- docker-ce
|
|
|
|
- docker-ce-cli
|
|
|
|
- containerd.io
|
|
|
|
- docker-buildx-plugin
|
|
|
|
- docker-compose-plugin
|
|
|
|
- docker-compose
|
2023-07-21 01:16:28 +00:00
|
|
|
|
|
|
|
- name: Create docker-compose folder for traefik
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /opt/docke-compsoe/traefik
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
|
|
|
|
- name: Create a symbolic link
|
|
|
|
ansible.builtin.file:
|
2023-07-21 01:17:37 +00:00
|
|
|
src: /opt/docke-compsoe/
|
|
|
|
dest: /root/docker-compose
|
2023-07-21 01:16:28 +00:00
|
|
|
state: link
|
|
|
|
|
|
|
|
- name: Template a file to /etc/file.conf
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: traefic-docker-compose.yml
|
|
|
|
dest: /etc/file.conf
|
|
|
|
owner: bin
|
|
|
|
group: wheel
|
|
|
|
mode: '0644'
|