aboutsummaryrefslogtreecommitdiffstats
path: root/generate_all
blob: 3a773942439b9b8710b8f79b2a90cdd25cb189aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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.