aboutsummaryrefslogtreecommitdiffstats
path: root/apply_roles
diff options
context:
space:
mode:
Diffstat (limited to 'apply_roles')
-rwxr-xr-xapply_roles31
1 files changed, 4 insertions, 27 deletions
diff --git a/apply_roles b/apply_roles
index 1551cc7..ad33233 100755
--- a/apply_roles
+++ b/apply_roles
@@ -5,33 +5,10 @@
# @usage
# Help fonction
function usage() {
- echo "Usage: ${0}
- -p : playbook file
- -r : roles to be applied
- -l : limit application to specific machines
- -h : show this help, then exit
- "
+ echo "Usage: ${0} \"role1 role2 .. roleN\" [ANSIBLE_ARGUMENTS]"
}
-while getopts "hp:r:l:" c; do
- case ${c} in
- p)
- playbook="${OPTARG}"
- ;;
- r)
- role="${OPTARG}"
- ;;
- l)
- limit="${OPTARG}"
- ;;
- h)
- usage;
- exit 0;
- esac
-done
-
-echo ${role}
-
-for current_role in ${role[@]}; do
- ansible-playbook "${playbook}" --tags "${current_role}" -l "${limit}"
+for role in ${1}; do
+ ansible_args=$(echo "${@:2}")
+ ansible-playbook ${ansible_args} --tags "${role}"
done
remember that computers suck.