#!/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