homeserver-iac/roles/containers/tasks/main.yml

24 lines
545 B
YAML

---
- name: Install Docker packages
community.general.pacman:
name:
- docker
- docker-compose
- name: Create docker-compose directory
ansible.builtin.file:
path: "{{ docker_compose_dir }}"
owner: "{{ admin_username }}"
group: "{{ admin_username }}"
state: directory
- name: Generate docker-compose.yml
template:
src: "docker-compose.yml"
dest: "{{ docker_compose_dir }}/docker-compose.yml"
- name: Docker compose up
community.docker.docker_compose:
project_src: "{{ docker_compose_dir }}"