forked from CiscoDevNet/cloud-cml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare.sh
executable file
·69 lines (63 loc) · 1.51 KB
/
prepare.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
#
# This file is part of Cisco Modeling Labs
# Copyright (c) 2019-2024, Cisco Systems, Inc.
# All rights reserved.
#
cd $(dirname $0)
ask_yes_no() {
while true; do
read -p "$1 (yes/no): " answer
answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]')
case $answer in
yes | y | true | 1)
return 0
;;
no | n | false | 0)
return 1
;;
*)
echo "Please answer yes or no."
;;
esac
done
}
cd modules/deploy
if ask_yes_no "Cloud - Enable AWS?"; then
echo "Enabling AWS."
rm aws.tf
ln -s aws-on.t-f aws.tf
else
echo "Disabling AWS."
rm aws.tf
ln -s aws-off.t-f aws.tf
fi
if ask_yes_no "Cloud - Enable Azure?"; then
echo "Enabling Azure."
rm azure.tf
ln -s azure-on.t-f azure.tf
else
echo "Disabling Azure."
rm azure.tf
ln -s azure-off.t-f azure.tf
fi
cd ../..
cd modules/secrets
if ask_yes_no "External Secrets Manager - Enable CyberArk Conjur?"; then
echo "Enabling CyberArk Conjur."
rm conjur.tf || true
ln -s conjur-on.t-f conjur.tf
else
echo "Disabling CyberArk Conjur."
rm conjur.tf || true
ln -s conjur-off.t-f conjur.tf
fi
if ask_yes_no "External Secrets Manager - Enable Hashicorp Vault?"; then
echo "Enabling Hashicorp Vault."
rm vault.tf || true
ln -s vault-on.t-f vault.tf
else
echo "Disabling Hashicorp Vault."
rm vault.tf || true
ln -s vault-off.t-f vault.tf
fi