task 추가 및 수정

This commit is contained in:
2025-07-07 16:57:48 +09:00
parent 22e4dd99a8
commit c9f731d438
5 changed files with 105 additions and 7 deletions

View File

@@ -1 +1,32 @@
ANSIBLE_STDOUT_CALLBACK=debug ANSIBLE_DISPLAY_SKIPPED_HOSTS=false ansible-playbook -i hosts -e target=$1 etcd-restore.yml
#!/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