1
0
Fork 0

Split long lines in when

This commit is contained in:
Daniele Tricoli 2021-05-28 16:48:46 +02:00
parent 17184de104
commit 3ba7cdf851
1 changed files with 10 additions and 5 deletions

View File

@ -41,7 +41,9 @@
groups: ssl-cert groups: ssl-cert
append: true append: true
become: true become: true
when: homeassistant_add_to_ssl_cert_group and "ssl-cert" in ansible_facts.getent_group when:
- homeassistant_add_to_ssl_cert_group
- ssl-cert in ansible_facts.getent_group
- name: add homeassistant user to dialout, gpio and i2c groups - name: add homeassistant user to dialout, gpio and i2c groups
user: user:
@ -89,13 +91,16 @@
- name: add custom TLS settings in configuration.yaml - name: add custom TLS settings in configuration.yaml
blockinfile: blockinfile:
path: /srv/homeassistant/.homeassistant/configuration.yaml path: "{{ homeassistant_dir }}/.homeassistant/configuration.yaml"
marker: "# {mark} ANSIBLE TLS SETTINGS" marker: "# {mark} ANSIBLE TLS SETTINGS"
block: | block: |
http: http:
ssl_certificate: /var/lib/dehydrated/certs/{{ domains[0].cname }}/chain.pem ssl_certificate: {{ homeassistant_ssl_certificate }}
ssl_key: /var/lib/dehydrated/certs/{{ domains[0].cname }}/privkey.pem ssl_key: {{ homeassistant_ssl_key }}
when: homeassistant_add_to_ssl_cert_group and "ssl-cert" in ansible_facts.getent_group when:
- homeassistant_add_to_ssl_cert_group
- ssl-cert in ansible_facts.getent_group
- homeassistant_ssl_certificate and homeassistant_ssl_key
notify: systemctl restart homeassistant notify: systemctl restart homeassistant
become: "{{ homeassistant_become }}" become: "{{ homeassistant_become }}"