added some more guiding STDOUT statements for commands and removed useless function
This commit is contained in:
@@ -64,7 +64,9 @@ import-gpg () {
|
|||||||
for id in "$@";
|
for id in "$@";
|
||||||
do
|
do
|
||||||
gpg --export-secret-keys "$id" > "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_GPG}/${id}.key"
|
gpg --export-secret-keys "$id" > "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_GPG}/${id}.key"
|
||||||
|
printf "Please manually add GPG key with 'id' of '%s' in 'users.\$username.gpg_keys' list of inventory file." "$id"
|
||||||
done
|
done
|
||||||
|
printf "Please manually change ID attribute of GPG keys in 'users.\$username.gpg_keys' list of inventory file."
|
||||||
}
|
}
|
||||||
|
|
||||||
import-ssl () {
|
import-ssl () {
|
||||||
@@ -73,6 +75,7 @@ import-ssl () {
|
|||||||
cp "/usr/local/share/ca-certificates/${domain}.key" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.key"
|
cp "/usr/local/share/ca-certificates/${domain}.key" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.key"
|
||||||
cp "/usr/local/share/ca-certificates/${domain}.pem" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.pem"
|
cp "/usr/local/share/ca-certificates/${domain}.pem" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.pem"
|
||||||
cp "/usr/local/share/ca-certificates/${domain}.crt" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.crt"
|
cp "/usr/local/share/ca-certificates/${domain}.crt" "${SKATO_BOOTSTRAP_ROLE}/files/${SKANSIBLE_SSL}/${domain}.crt"
|
||||||
|
printf "Please manually change 'fqdn' attribute in inventory file to '%s'." "$domain"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,10 +87,6 @@ import () {
|
|||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
mksecret () {
|
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
decrypt () {
|
decrypt () {
|
||||||
while getopts "mv:i:d:" flag; do
|
while getopts "mv:i:d:" flag; do
|
||||||
case "$flag" in
|
case "$flag" in
|
||||||
@@ -159,12 +158,19 @@ encrypt () {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "Make sure to copy following output to appropriate YAML location.\n"
|
printf "Make sure to copy following to appropriate location in appropriate YAML file under %s: \n" "$SKATO_ANSIBLE_ROOT"
|
||||||
if [[ -z "$VAR_NAME" ]]; then
|
if [[ -z "$VAR_NAME" ]]; then
|
||||||
ansible-vault encrypt_string --name "$VAR_NAME" --stdin-name "$VAR_NAME" --vault-id "$VAULT_ID" --output - "$PASSWORD"
|
ansible-vault encrypt_string --name "$VAR_NAME" --stdin-name "$VAR_NAME" --vault-id "$VAULT_ID" --output - "$PASSWORD"
|
||||||
else
|
else
|
||||||
ansible-vault encrypt_string --stdin-name "$ID_TAG" --vault-id "$VAULT_ID" --output - "$PASSWORD"
|
ansible-vault encrypt_string --stdin-name "$ID_TAG" --vault-id "$VAULT_ID" --output - "$PASSWORD"
|
||||||
fi
|
fi
|
||||||
|
YAMLS_WITH_PASSWORDS=("${SKATO_BOOTSTRAP_ROLE}/vars/main/software.yml" "${SKATO_BOOTSTRAP_ROLE}/defaults/main/software.yml")
|
||||||
|
printf "Examples of common YAML files passwords may be in: \n"
|
||||||
|
printf " 1. any YAML file in %s \n" "${SKATO_ANSIBLE_ROOT}/hostvars"
|
||||||
|
printf " 2. any YAML file in %s \n" "${SKATO_ANSIBLE_ROOT}/groupvars"
|
||||||
|
for i in "${!YAMLS_WITH_PASSWORDS[@]}"; do
|
||||||
|
printf " %u. %s \n" "$(( i + 3 ))" "${YAMLS_WITH_PASSWORDS[$i]}"
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
# source ./extensions.d/edit.sh
|
# source ./extensions.d/edit.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user