From 8c6cdf3cd11c1ac52b41a3323d0a3b68e554c473 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Thu, 31 Dec 2020 00:03:58 +0100
Subject: [PATCH] Enable generating of the certificates

---
 .gitignore     |  1 +
 orchestrate.py | 15 ++++++++++++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 8738465..10e4b11 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ public_hosts
 secrets.auto.tfvars
 site.pp
 site2.pp
+site.yaml
 terraform
 terraform.tfstate
 terraform.tfstate.backup
diff --git a/orchestrate.py b/orchestrate.py
index 36cb1ef..3709281 100755
--- a/orchestrate.py
+++ b/orchestrate.py
@@ -103,6 +103,17 @@ ff02::2 ip6-allrouters
 %s ansible_user=%s ansible_become=true ansible_host=%s ansible_ssh_common_args=\'\
 -o ForwardAgent=yes -o ProxyCommand="ssh -W %s:22 -q %s@%s"\'\n' % (h, user, ip, ip, user,
                                                                     master_ip))
+
+    print('-> site.yaml')
+    if not args.dry_run:
+        with open('site.yaml', 'w') as f:
+            f.write('''\
+- hosts: all
+  roles:
+    - role: certgen
+      certgen_master: %s
+''' % master_hostname)
+
     if component:
         component.action('files')
 
@@ -184,5 +195,7 @@ if 'wait' in args.actions:
 
 if 'deployment' in args.actions:
     print('== deployment ==')
-    commands = []
+    commands = [
+        ['ansible-playbook', '-i', 'inventory', './site.yaml']
+    ]
     perform_action('deployment', commands)
-- 
GitLab