Skip to content

Instantly share code, notes, and snippets.

@aoki
Last active October 12, 2017 14:40
Show Gist options
  • Save aoki/aeecfe3ff154d7a4456928e593b98c66 to your computer and use it in GitHub Desktop.
Save aoki/aeecfe3ff154d7a4456928e593b98c66 to your computer and use it in GitHub Desktop.
Ansible execution test scripts on docker.
#!/bin/bash -eu
read -p "📦 Input component (e.g. web/batch): " component
read -p "🎫 Input task if you want to choice start task (e.g. 'Install docker-compose'): " startAt
read -p "💡 Using --step? (y/n): " step
case $step in
[yY]|[yY]es|yes|YES) step='--step';;
*) unset step;;
esac
ansible-playbook -c docker -u root \
-i test/inventories/docker \
--vault-password-file ./keys/local.key \
--skip-tag docker-ignore \
${startAt:+--start-at "${startAt}"} \
${step:+--step} \
test/playbooks/docker-${component}.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment