add option to install plugins
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
56e20abcf2
commit
46ec97b051
|
@ -19,6 +19,9 @@ homeassistant_networks:
|
||||||
homeassistant_networks_applied:
|
homeassistant_networks_applied:
|
||||||
- default
|
- default
|
||||||
|
|
||||||
|
homeassistant_data_dir: /opt/homeassistant/config
|
||||||
|
homeassistant_plugin_dir: /opt/homeassistant/config/www/plugins
|
||||||
|
|
||||||
# @var homeassistant_volumes:description: Define required docker volumes.
|
# @var homeassistant_volumes:description: Define required docker volumes.
|
||||||
# @var homeassistant_volumes:example: >
|
# @var homeassistant_volumes:example: >
|
||||||
# homeassistant_volumes:
|
# homeassistant_volumes:
|
||||||
|
@ -34,7 +37,7 @@ homeassistant_networks_applied:
|
||||||
# bind_opt: "ro,z"
|
# bind_opt: "ro,z"
|
||||||
# @end
|
# @end
|
||||||
homeassistant_volumes:
|
homeassistant_volumes:
|
||||||
- name: /opt/homeassistant/config
|
- name: "{{ homeassistant_data_dir }}"
|
||||||
dest: /config
|
dest: /config
|
||||||
bind: True
|
bind: True
|
||||||
|
|
||||||
|
@ -79,3 +82,13 @@ homeassistant_exclude_modemmanager: False
|
||||||
homeassistant_serial_device:
|
homeassistant_serial_device:
|
||||||
- vendor_id: "0000"
|
- vendor_id: "0000"
|
||||||
product_id: "xxxx"
|
product_id: "xxxx"
|
||||||
|
|
||||||
|
# @var homeassistant_plugins:description: Plugins will be downloaded to `homeassistant_plugin_dir` and need to be a single raw file.
|
||||||
|
# @var homeassistant_plugins:example: >
|
||||||
|
# homeassistant_plugins:
|
||||||
|
# - name: button-card.js
|
||||||
|
# url: https://github.com/custom-cards/button-card/releases/download/v3.4.2/button-card.js
|
||||||
|
# - name: card-tools.js
|
||||||
|
# url: https://raw.githubusercontent.com/thomasloven/lovelace-card-tools/11/card-tools.js
|
||||||
|
# @end
|
||||||
|
homeassistant_plugins: []
|
||||||
|
|
|
@ -16,6 +16,14 @@
|
||||||
label: "{{ item.name }}"
|
label: "{{ item.name }}"
|
||||||
when: item.bind | bool
|
when: item.bind | bool
|
||||||
|
|
||||||
|
- name: Prepare directories
|
||||||
|
file:
|
||||||
|
path: "{{ item }}"
|
||||||
|
state: directory
|
||||||
|
mode: 0640
|
||||||
|
loop:
|
||||||
|
- "{{ homeassistant_plugin_dir }}"
|
||||||
|
|
||||||
- name: Deploy compose file to '{{ homeassistant_service_directory }}'
|
- name: Deploy compose file to '{{ homeassistant_service_directory }}'
|
||||||
template:
|
template:
|
||||||
src: "services/homeassistant_compose.yml.j2"
|
src: "services/homeassistant_compose.yml.j2"
|
||||||
|
@ -40,6 +48,13 @@
|
||||||
when: homeassistant_exclude_modemmanager | bool
|
when: homeassistant_exclude_modemmanager | bool
|
||||||
notify: __udev_reload
|
notify: __udev_reload
|
||||||
|
|
||||||
|
- name: Fetch plugins
|
||||||
|
get_url:
|
||||||
|
url: "{{ item.url }}"
|
||||||
|
dest: "{{ homeassistant_plugin_dir }}/{{ item.name }}"
|
||||||
|
mode: 0640
|
||||||
|
loop: "{{ homeassistant_plugins }}"
|
||||||
|
|
||||||
- name: Ensure service is up and running
|
- name: Ensure service is up and running
|
||||||
docker_compose:
|
docker_compose:
|
||||||
project_src: "{{ homeassistant_service_directory }}"
|
project_src: "{{ homeassistant_service_directory }}"
|
||||||
|
|
Loading…
Reference in New Issue