Move automations to single file
This commit is contained in:
parent
479fa18e40
commit
ee9017becd
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
.idea/
|
||||
|
||||
configuration/secrets.yaml
|
||||
|
||||
build/
|
@ -1,5 +1,5 @@
|
||||
# Configure a default setup of Home Assistant (frontend, api, etc)
|
||||
automation: !include_dir_merge_list automations/
|
||||
automation: !include automations.yaml
|
||||
#cloud:
|
||||
config:
|
||||
counter:
|
||||
|
@ -5,14 +5,22 @@
|
||||
file:
|
||||
path: '{{ pwd_config }}/automations'
|
||||
state: absent
|
||||
- name: Create automations directory
|
||||
- name: Create build directory
|
||||
delegate_to: localhost
|
||||
file:
|
||||
path: '{{ pwd_config }}/automations'
|
||||
path: './build/automations'
|
||||
state: directory
|
||||
- name: Concat automation
|
||||
delegate_to: localhost
|
||||
ansible.builtin.assemble:
|
||||
remote_src: no
|
||||
src: './configuration/automations'
|
||||
dest: './build/automations/automations-base.yaml'
|
||||
- name: Build lights automations
|
||||
delegate_to: localhost
|
||||
template:
|
||||
src: lights.yaml.j2
|
||||
dest: '{{ pwd_config }}/automations/lights.yaml'
|
||||
dest: './build/automations/lights.yaml'
|
||||
vars:
|
||||
lights:
|
||||
- entityId: light.bathroom_lights
|
||||
@ -27,11 +35,11 @@
|
||||
name: Desk Lightbar
|
||||
- entityId: light.office
|
||||
name: Table lamp
|
||||
- name: Copy rest of automations
|
||||
copy:
|
||||
src: configuration/automations
|
||||
dest: '{{ pwd_config }}'
|
||||
directory_mode: yes
|
||||
- name: Concat automation 2
|
||||
ansible.builtin.assemble:
|
||||
remote_src: no
|
||||
src: './build/automations/'
|
||||
dest: '{{ pwd_config }}/automations.yaml'
|
||||
- name: Concat scripts
|
||||
ansible.builtin.assemble:
|
||||
remote_src: no
|
||||
|
Loading…
Reference in New Issue
Block a user