1
0
Fork 0
ansible-home-assistant/home-assistant.yml

68 lines
2 KiB
YAML
Raw Normal View History

2020-11-04 00:55:41 +01:00
---
- hosts: home-assistant
2021-05-24 20:26:03 +02:00
tasks:
- name: Remove automations directory
file:
path: '{{ pwd_config }}/automations'
state: absent
2021-12-18 13:34:17 +01:00
- name: Create build directory
delegate_to: localhost
file:
2021-12-18 13:34:17 +01:00
path: './build/automations'
state: directory
2021-12-18 13:34:17 +01:00
- name: Concat automation
delegate_to: localhost
ansible.builtin.assemble:
remote_src: no
src: './configuration/automations'
dest: './build/automations/automations-base.yaml'
2021-05-24 20:26:03 +02:00
- name: Build lights automations
2021-12-18 13:34:17 +01:00
delegate_to: localhost
2021-05-24 20:26:03 +02:00
template:
src: lights.yaml.j2
2021-12-18 13:34:17 +01:00
dest: './build/automations/lights.yaml'
2021-05-24 20:26:03 +02:00
vars:
lights:
- entityId: light.bathroom_lights
name: Bathroom Lights
- entityId: light.kitchen_lights
name: Kitchen Lights
- entityId: light.shower_lights
name: Shower Lights
- entityId: light.couch_lights
name: Couch Lights
2021-05-24 23:03:45 +02:00
- entityId: light.desk_lightbar
name: Desk Lightbar
2021-12-14 16:09:31 +01:00
- entityId: light.office
name: Table lamp
2021-12-18 13:34:17 +01:00
- name: Concat automation 2
ansible.builtin.assemble:
remote_src: no
src: './build/automations/'
dest: '{{ pwd_config }}/automations.yaml'
2021-05-25 00:10:22 +02:00
- name: Concat scripts
ansible.builtin.assemble:
remote_src: no
src: ./scripts
dest: '{{ pwd_config }}/scripts.yaml'
2021-11-25 00:13:32 +01:00
- name: Copy configuration
copy:
src: configuration/configuration.yaml
dest: '{{ pwd_config }}/configuration.yaml'
2022-04-29 19:55:03 +02:00
- name: Copy customize
copy:
src: configuration/customize.yaml
dest: '{{ pwd_config }}/customize.yaml'
2022-04-30 15:07:23 +02:00
- name: Copy groups
copy:
src: configuration/groups.yaml
dest: '{{ pwd_config }}/groups.yaml'
2021-11-25 00:13:32 +01:00
- name: Copy secrets
copy:
src: configuration/secrets.yaml
dest: '{{ pwd_config }}/secrets.yaml'
2021-12-06 23:31:28 +01:00
- name: Copy scripts
copy:
src: python_scripts
dest: '{{ pwd_config }}'
directory_mode: yes