diff --git a/roles/homeassistant/tasks/main.yml b/roles/homeassistant/tasks/main.yml index 0f8f485..d794359 100644 --- a/roles/homeassistant/tasks/main.yml +++ b/roles/homeassistant/tasks/main.yml @@ -50,8 +50,7 @@ append: true become: true when: - - homeassistant_add_to_ssl_cert_group - - ssl-cert in ansible_facts.getent_group + - homeassistant_add_to_ssl_cert_group and "ssl-cert" in ansible_facts.getent_group - name: add homeassistant user to dialout, gpio and i2c groups user: @@ -114,8 +113,7 @@ ssl_certificate: {{ homeassistant_ssl_certificate }} ssl_key: {{ homeassistant_ssl_key }} when: - - homeassistant_add_to_ssl_cert_group - - ssl-cert in ansible_facts.getent_group + - homeassistant_add_to_ssl_cert_group and "ssl-cert" in ansible_facts.getent_group - homeassistant_ssl_certificate and homeassistant_ssl_key notify: systemctl restart homeassistant diff --git a/tests/test.yml b/tests/test.yml index 723d02f..b120db4 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -52,7 +52,10 @@ state: absent remove: true influxdb_bind_hostname: 127.0.0.1 - homeassistant_influxdb_host: 127.0.0.1 + homeassistant_add_to_ssl_cert_group: true + homeassistant_ssl_certificate: /var/lib/snakeoil/certs/example.org/fullchain.pem + homeassistant_ssl_key: /var/lib/snakeoil/certs/example.org/privkey.pem + # homeassistant_influxdb_host: 127.0.0.1 roles: # - ../roles/apt_dist_upgrade # - ../roles/common @@ -61,7 +64,7 @@ # - ../roles/iptables # - ../roles/sshd # - ../roles/fail2ban - # - ../roles/snake_oil_cert + - ../roles/snake_oil_cert # - ../roles/users # - ../roles/dehydrated # - ../roles/nginx @@ -79,7 +82,7 @@ # beehive_bind: 10.10.10.10:8181, # beehive_canonical_url: http://10.10.10.10:8181} # - ../roles/mosquitto - - ../roles/influxdb + # - ../roles/influxdb - ../roles/homeassistant # - {role: ../roles/generate_ca, become: true} # - {role: ../roles/generate_certificate, become: true}