1
0
Fork 0
myserver-configuration/roles/home_assistant/tasks/base.yml

23 lines
No EOL
609 B
YAML

---
- name: Check home_assistant directory exist
ansible.builtin.file:
path: home_assistant
state: directory
- name: Copy template conf
ansible.builtin.template:
backup: true
src: "{{ item.src }}"
dest: "home_assistant/{{ item.dest }}"
loop:
- { src: 'docker-compose.yml.j2', dest: 'docker-compose.yml' }
register: home_assistant_copy_templates_results
- name: Update and restart container
community.docker.docker_compose:
project_src: home_assistant
state: present
pull: true
restarted: "{{ home_assistant_copy_templates_results.changed }}"
become: true