ansible: Configure control ports
authorKristof Provost <kp@FreeBSD.org>
Mon, 10 Jul 2023 20:24:16 +0000 (22:24 +0200)
committerKristof Provost <kp@FreeBSD.org>
Mon, 10 Jul 2023 21:05:22 +0000 (23:05 +0200)
Each instance will have its own port to loop back on kosmos.codepro.be.
Assign a unique port to each, and save it in sysrc.

We'll have to script something around autossh, but this is the main new
ansible feature to test.

ansible/inventory.yaml
ansible/playbook-pull.yaml

index 35098a3..76fd443 100644 (file)
@@ -1,7 +1,12 @@
 domoticamachines:
   hosts:
     pennestraat20:
+      control_port: 2400
     pennestraat22:
+      control_port: 2401
     pennestraat22a:
+      control_port: 2402
     qemu:
+      control_port: 2403
     poudriere-image:
+      control_port: 0
index f3a35b9..32606f0 100644 (file)
@@ -8,6 +8,10 @@
 - name: test playbook
   hosts: domoticamachines
   tasks:
+    - name: autossh config
+      community.general.sysrc:
+        name: control_port
+        value: "{{ control_port }}"
     - name: Install nginx
       community.general.pkgng:
         name: nginx