Forked from
infrastruktur / ansible-warpzone
763 commits behind the upstream repository.
main.yml 1.40 KiB
---
- include_tasks: ../functions/get_secret.yml
with_items:
- { path: "{{ basedir }}/wlan_pass", length: -1 }
- name: "create folder struct for {{ servicename }}"
file:
path: "{{ item }}"
state: "directory"
with_items:
- "{{ basedir }}/"
- "{{ basedir }}/config/"
- name: "create config files for {{ servicename }}"
template:
src: "{{ item }}"
dest: "{{ basedir }}/{{ item }}"
with_items:
- docker-compose.yml
- compile.sh
- config/esphome_dach.yaml
- config/esphome_feinstaub01.yaml
- config/esphome_hauptraum.yaml
- config/esphome_holzwerkstatt.yaml
- config/esphome_kamin.yaml
- config/esphome_kuehlschrank.yaml
- config/esphome_lounge.yaml
- config/esphome_luftfilter01.yaml
- config/esphome_vortragsraum.yaml
- config/esphome_strommesser.yaml
- config/esphome_frekvens.yaml
- config/esphome_obegraensad.yaml
register: config
- name: download config includes files
get_url:
url: "https://raw.githubusercontent.com/esphome/esphome-docs/current/_static/{{ item }}"
dest: "{{ basedir }}/config/{{ item }}"
with_items:
- webserver-v1.min.css
- webserver-v1.min.js
- name: "stop {{ servicename }} docker"
docker_compose:
project_src: "{{ basedir }}"
state: absent
when: config.changed
- name: "start {{ servicename }} docker"
docker_compose:
project_src: "{{ basedir }}"
state: present