Browse Source

Move use a variable to defin configuration directory

main
Daniele Tricoli 4 months ago
parent
commit
f934c9392c
  1. 1
      roles/homeassistant/defaults/main.yml
  2. 10
      roles/homeassistant/tasks/main.yml
  3. 2
      roles/homeassistant/templates/etc/systemd/system/homeassistant.service.j2

1
roles/homeassistant/defaults/main.yml

@ -3,6 +3,7 @@ homeassistant_become: true
homeassistant_become_user: root
homeassistant_dir: /srv/homeassistant
homeassistant_config_dir: /etc/homeassistant
is_a_raspberrypi: false
homeassistant_add_to_ssl_cert_group: false

10
roles/homeassistant/tasks/main.yml

@ -35,6 +35,14 @@
getent:
database: group
- name: ensure that {{ homeassistant_config_dir }} exists
file:
path: "{{ homeassistant_config_dir }}"
state: directory
owner: homeassistant
group: root
mode: "0750"
- name: add homeassistant user to ssl-cert group
user:
name: homeassistant
@ -87,7 +95,7 @@
- name: add custom TLS settings in configuration.yaml
blockinfile:
path: "{{ homeassistant_dir }}/.homeassistant/configuration.yaml"
path: "{{ homeassistant_config_dir }}/configuration.yaml"
marker: "# {mark} ANSIBLE TLS SETTINGS"
block: |
http:

2
roles/homeassistant/templates/etc/systemd/system/homeassistant.service.j2

@ -6,7 +6,7 @@ Wants=network-online.target
[Service]
# WorkingDirectory={{ homeassistant_dir }}
ExecStart={{ homeassistant_dir }}/bin/hass -c "{{ homeassistant_dir }}/.homeassistant"
ExecStart={{ homeassistant_dir }}/bin/hass -c "{{ homeassistant_config_dir }}"
User=homeassistant
Group=homeassistant
Restart=on-failure

Loading…
Cancel
Save