aboutsummaryrefslogtreecommitdiffstats
path: root/generate_all
diff options
context:
space:
mode:
authorbinary <me@rgoncalves.se>2020-08-11 12:09:38 +0200
committerbinary <me@rgoncalves.se>2020-08-11 12:09:38 +0200
commitda3101946e72a5ecfe8daf81c7213904b372776b (patch)
tree4df3dc010593f1b9c03851f5353d69332652a7a0 /generate_all
parente14b4f0a4b4a89b2a5cd4a2989496b8c4e7740e8 (diff)
downloadinfrastructure-da3101946e72a5ecfe8daf81c7213904b372776b.tar.gz
rev1 for generating per-tags playbook
Diffstat (limited to 'generate_all')
-rwxr-xr-xgenerate_all22
1 files changed, 22 insertions, 0 deletions
diff --git a/generate_all b/generate_all
new file mode 100755
index 0000000..3a77394
--- /dev/null
+++ b/generate_all
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Generate specific ansible playbook with all roles inside,
+# ready to be called with "--tags" argument
+
+ROLES_DIR="./roles"
+ROLES=$(ls ${ROLES_DIR})
+PLAYBOOK_OUT="play-all.yml"
+
+echo "" > ${PLAYBOOK_OUT}
+
+for role in ${ROLES[@]}; do
+cat << EOF >> ${PLAYBOOK_OUT}
+- name: Standalone role [-] ${role}
+ hosts: all
+ tags:
+ - ${role}
+ roles:
+ - ${role}
+
+EOF
+done
remember that computers suck.