aboutsummaryrefslogblamecommitdiffstats
path: root/generate_all
blob: 3a773942439b9b8710b8f79b2a90cdd25cb189aa (plain) (tree)





















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