From da3101946e72a5ecfe8daf81c7213904b372776b Mon Sep 17 00:00:00 2001 From: binary Date: Tue, 11 Aug 2020 12:09:38 +0200 Subject: rev1 for generating per-tags playbook --- generate_all | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 generate_all 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 -- cgit v1.2.3