Initial data for ansible added

This commit is contained in:
Dirk Alders 2024-11-17 11:30:46 +01:00
parent 7bfc169b97
commit f11a8f42c9
3 changed files with 61 additions and 6 deletions

16
.gitignore vendored
View File

@ -1,9 +1,6 @@
# ---> Backup # Zigbee2MQTT repo rule
*.bak config/configuration.yaml
*.gho config/log
*.ori
*.orig
*.tmp
# ---> Linux # ---> Linux
*~ *~
@ -20,3 +17,10 @@
# .nfs files are created when an open file is removed but is still being accessed # .nfs files are created when an open file is removed but is still being accessed
.nfs* .nfs*
# ---> Backup
*.bak
*.gho
*.ori
*.orig
*.tmp

30
bin/c2r.py Executable file
View File

@ -0,0 +1,30 @@
#!/bin/python3
#
import re
import sys
try:
src_file = sys.argv[1]
dst_file = sys.argv[2]
except IndexError:
print(sys.argv[0], "<src> <dst>")
sys.exit(17)
try:
with open(src_file, 'r') as fh:
s = fh.read()
except (PermissionError, FileNotFoundError) as e:
print("Unable to open", '"' + src_file + '"')
sys.exit(18)
n = re.sub('^.*server: .*', ' server: mqtt://{{ smart_sat_zigbee2mqtt_hostname }}', s, flags=re.MULTILINE)
n = re.sub('^.*user: .*', ' user: {{ smart_sat_zigbee2mqtt_username }}', n, flags=re.MULTILINE)
n = re.sub('^.*password: .*', ' password: {{ smart_sat_zigbee2mqtt_password }}', n, flags=re.MULTILINE)
n = re.sub('^.*auth_token: .*', ' auth_token: {{ smart_sat_zigbee2mqtt_auth_token }}', n, flags=re.MULTILINE)
try:
with open(dst_file, 'w') as fh:
fh.write(n)
except PermissionError:
print("Unable to write", '"' + dst_file + '"')
sys.exit(19)

View File

@ -0,0 +1,21 @@
homeassistant: false
permit_join: false
mqtt:
base_topic: zigbee_gfe
server: mqtt://{{ smart_sat_zigbee2mqtt_hostname }}
user: {{ smart_sat_zigbee2mqtt_username }}
password: {{ smart_sat_zigbee2mqtt_password }}
serial:
port: /dev/ttyACM0
advanced:
network_key: GENERATE
ikea_ota_use_test_url: true
legacy_api: false
channel: 25
homeassistant_legacy_entity_attributes: false
legacy_availability_payload: false
frontend:
port: 8038
host: 0.0.0.0
auth_token: {{ smart_sat_zigbee2mqtt_auth_token }}
url: http://localhost