From: Kristof Provost Date: Sat, 8 Mar 2025 18:06:58 +0000 (+0100) Subject: set per-house passwords for the domotica app X-Git-Url: https://git.sigsegv.be/?a=commitdiff_plain;h=45a70b21fd95c6851c661e445362e95211b9be29;p=pennestraat-domotica set per-house passwords for the domotica app --- diff --git a/ansible/inventory.yaml b/ansible/inventory.yaml index a985639..6461329 100644 --- a/ansible/inventory.yaml +++ b/ansible/inventory.yaml @@ -8,6 +8,13 @@ domoticamachines: pf_file: "pf.conf" lan_ip: "172.30.2.1/24" hostname: "qemu.sigsegv.be" + domotica_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 33343133353739653165343638646265363432636232373165346237366135316365313331343261 + 3238303562336536663562323030353135623031336230610a633936656532376236363962353866 + 61366661353531363365333139373462346239616631353866626438643361643731346132623332 + 3232336335366538390a383036393463653130373139663066373063643936336631393661646335 + 6539 pennestraat20: control_port: 2401 ansible_port: 2401 @@ -16,6 +23,13 @@ domoticamachines: pf_file: "pf.conf" lan_ip: "172.30.2.1/24" hostname: "20.pennestraat.sigsegv.be" + domotica_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 37333465333439326264633535666231643038343664663964363766623735373334643232636132 + 6663656331663139366438326631306237393637386464380a623330353138626330626235363935 + 39356661383837336662663264313635656430313735383864353061333634393234336431653237 + 3036633563343263310a313162343232333731633764303363643133333761393938666661633430 + 6563 pennestraat22: control_port: 2402 ansible_port: 2402 @@ -24,6 +38,13 @@ domoticamachines: pf_file: "pf.conf" lan_ip: "172.30.2.1/24" hostname: "22.pennestraat.sigsegv.be" + domotica_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 35663838306266366334633434363838656538313534636131393535656639626131373533316537 + 3466306135363238643465383365663831656561346464360a373932663664303138643465336233 + 62373164373462383230363064393231346334363464616532613866306137346433616262383464 + 3132623837666239370a396264656165316539663939326364646464313761376264393731663336 + 3566 pennestraat22a: control_port: 2403 ansible_port: 2403 @@ -32,6 +53,13 @@ domoticamachines: pf_file: "pf.conf" lan_ip: "172.30.2.1/24" hostname: "22a.pennestraat.sigsegv.be" + domotica_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 63363436613734353130353539646535323339323365343265663139663834376562623332663566 + 3035643531393436346335346232623532336366353266370a383734333366346566336166626332 + 33363963616663313636343639653338316533303037613331303035303630306265353731646430 + 6262346136613438310a323736616365643630326239363563393634313432376531386236333262 + 3965 initial: hosts: diff --git a/ansible/roles/domotica/tasks/domotica.yaml b/ansible/roles/domotica/tasks/domotica.yaml index c40cc6d..159a9bc 100644 --- a/ansible/roles/domotica/tasks/domotica.yaml +++ b/ansible/roles/domotica/tasks/domotica.yaml @@ -64,23 +64,16 @@ import sys from django.contrib.auth.models import User try: - User.objects.get(username="natalie") + User.objects.get(username="user") sys.exit(0) except User.DoesNotExist: - user = User.objects.create_user("natalie", "natalie@sigsegv.be", "nienkeistwee") + user = User.objects.create_user("user", "user@user.foo", "{{ domotica_password }}") user.save() ' environment: - PYTHONPATH: /home/kp/libs7comm-python/ - LD_LIBRARY_PATH: /home/kp/libs7comm/src/lib - DJANGO_SETTINGS_MODULE: domotica.settings - - DJANGO_SUPERUSER_PASSWORD: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 32613637306262326561303164623937336137666130383333353266353162393036313961393762 - 3132323639633235376231336663633031646561386231300a376530353438653863363633353961 - 30346337623034313666383233613366623835336561643533323562363264643839613239323237 - 6363666633626334370a316163643864633330313533363766653431323161386330626564383039 - 3236 - name: set db ownership ansible.builtin.file: path: /home/kp/domotica/domotica.sqlite3