mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
- Docker role: replace docker-compose with docker-compose-plugin (v2). The old docker-compose package conflicts with docker-compose-plugin already installed on helsinki-a. Also removes the conflicting package if present. - firewall_alpine handler: use ansible.builtin.shell instead of ansible.builtin.command for iptables-restore, since the redirect operator (<) requires a shell.
37 lines
896 B
YAML
37 lines
896 B
YAML
---
|
|
# Install Docker and docker-compose, start the daemon.
|
|
|
|
- name: Install Docker (Debian)
|
|
ansible.builtin.apt:
|
|
name:
|
|
- docker.io
|
|
- docker-compose-plugin
|
|
state: present
|
|
when: ansible_facts["os_family"] == "Debian"
|
|
|
|
- name: Remove conflicting docker-compose package (Debian)
|
|
ansible.builtin.apt:
|
|
name: docker-compose
|
|
state: absent
|
|
when: ansible_facts["os_family"] == "Debian"
|
|
|
|
- name: Install Docker (Alpine)
|
|
community.general.apk:
|
|
name:
|
|
- docker
|
|
- docker-cli-compose
|
|
state: present
|
|
when: ansible_facts["os_family"] == "Alpine"
|
|
|
|
- name: Enable and start Docker
|
|
ansible.builtin.service:
|
|
name: docker
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Create docker compose project directories
|
|
ansible.builtin.file:
|
|
path: "/opt/docker/{{ item }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop: "{{ docker_services | default([]) }}"
|