#!/bin/bash if [ $# -eq 0 ]; then echo "Usage: etcd-restore.sh ['host' or 'member']" exit 1 fi more lic.txt echo '' while [ -z $prompt ]; do read -p "DO YOU ACCEPT THE TERMS OF THIS LINCESE AGREEMENT? [y/n] : " choice; case "$choice" in y|Y ) prompt=true; break;; n|N ) exit 0;; esac; done; if which ansible-playbook >/dev/null; then if [ $1 == "host" ]; then ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=false ansible-playbook -i hosts -e target=host etcd-restore.yml elif [ $1 == "member" ]; then ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=false ansible-playbook -i hosts -e target=member etcd-restore.yml else echo "Usage: etcd-restore.sh ['host' or 'member']" exit 1 fi else echo 'Error: ansible is not installed.' >&2 exit 1 fi