From fbde9090a92a3c32e60705d2c37bd556d3b85192 Mon Sep 17 00:00:00 2001
From: Stefan Haun <tux@netz39.de>
Date: Sat, 23 Jul 2022 17:35:08 +0200
Subject: [PATCH] Set up gatekeeper user (pi)

This is the user that will manage door and shutters
---
 inventory.yml |  1 +
 platon.yml    | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/inventory.yml b/inventory.yml
index cc44353..beed07b 100644
--- a/inventory.yml
+++ b/inventory.yml
@@ -77,6 +77,7 @@ all:
     platon.n39.eu:
       server_admin: "admin+platon@netz39.de"
       mac: "b8:27:eb:8f:98:2f"
+      gatekeeper_user: pi
     radon.n39.eu:
       server_admin: "admin+radon@netz39.de"
     krypton.n39.eu:
diff --git a/platon.yml b/platon.yml
index c22c3c3..8ea6ea5 100644
--- a/platon.yml
+++ b/platon.yml
@@ -45,3 +45,14 @@
       ansible.builtin.copy:
         src: files/platon/sesam-door-open.sh
         dest: /home/sesam/door-open.sh
+
+
+    ### Gatekeeper user (pi for now)
+    #
+    # All the gatekeeping / door control stuff is here!
+
+    - name: Ensure gatekeeper user is there
+      ansible.builtin.user:
+        name: "{{ gatekeeper_user }}"
+        groups: dialout,audio,plugdev,input,netdev,i2c,gpio
+        append: yes