2020-11-03 23:55:41 +00:00
|
|
|
---
|
2021-11-15 22:54:07 +00:00
|
|
|
- hosts: home-assistant
|
2021-05-24 18:26:03 +00:00
|
|
|
tasks:
|
2021-11-15 22:54:07 +00:00
|
|
|
- name: Remove automations directory
|
|
|
|
file:
|
|
|
|
path: '{{ pwd_config }}/automations'
|
|
|
|
state: absent
|
|
|
|
- name: Create automations directory
|
|
|
|
file:
|
|
|
|
path: '{{ pwd_config }}/automations'
|
|
|
|
state: directory
|
2021-05-24 18:26:03 +00:00
|
|
|
- name: Build lights automations
|
|
|
|
template:
|
|
|
|
src: lights.yaml.j2
|
2021-11-15 22:54:07 +00:00
|
|
|
dest: '{{ pwd_config }}/automations/lights.yaml'
|
2021-05-24 18:26:03 +00:00
|
|
|
vars:
|
|
|
|
lights:
|
|
|
|
- entityId: light.bathroom_lights
|
|
|
|
name: Bathroom Lights
|
|
|
|
- entityId: light.kitchen_lights
|
|
|
|
name: Kitchen Lights
|
|
|
|
- entityId: light.shower_lights
|
|
|
|
name: Shower Lights
|
2021-08-26 18:04:36 +00:00
|
|
|
- entityId: light.couch_lights
|
|
|
|
name: Couch Lights
|
2021-05-24 21:03:45 +00:00
|
|
|
- entityId: light.desk_lightbar
|
|
|
|
name: Desk Lightbar
|
2021-09-22 21:41:16 +00:00
|
|
|
- entityId: light.table_lamp
|
|
|
|
name: Table lamp
|
2021-11-15 22:54:07 +00:00
|
|
|
- name: Copy rest of automations
|
|
|
|
copy:
|
|
|
|
src: configuration/automations
|
|
|
|
dest: '{{ pwd_config }}'
|
|
|
|
directory_mode: yes
|
2021-05-24 22:10:22 +00:00
|
|
|
- name: Concat scripts
|
|
|
|
ansible.builtin.assemble:
|
2021-11-15 22:54:07 +00:00
|
|
|
remote_src: no
|
|
|
|
src: ./scripts
|
|
|
|
dest: '{{ pwd_config }}/scripts.yaml'
|
2021-11-24 23:13:32 +00:00
|
|
|
- name: Copy configuration
|
|
|
|
copy:
|
|
|
|
src: configuration/configuration.yaml
|
|
|
|
dest: '{{ pwd_config }}/configuration.yaml'
|
|
|
|
- name: Copy secrets
|
|
|
|
copy:
|
|
|
|
src: configuration/secrets.yaml
|
|
|
|
dest: '{{ pwd_config }}/secrets.yaml'
|