From 5f2d02f600c151e255b40a8a15fb93281d6b45a2 Mon Sep 17 00:00:00 2001 From: LeeW Date: Fri, 7 Feb 2025 10:47:34 +0100 Subject: [PATCH] adds roles, iter x/n --- bin/update_sops.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/update_sops.sh b/bin/update_sops.sh index 40dc290..e396674 100755 --- a/bin/update_sops.sh +++ b/bin/update_sops.sh @@ -9,11 +9,12 @@ repo_root="$(realpath $(dirname "${BASH_SOURCE[0]}")/..)" keyfiles_dir="${repo_root}" # assume location of secrets config file in pwd sops_config_dir="${PWD}" +# path to role definitions +roles_def_dir="${repo_root}/roles" +# optional: +opt_list_roles=0 # optional: secrets files to be updated secrets_file_list=() -# optional: -opt_list_roles=0 -roles_def_dir="${repo_root}/roles" while (( $# >= 1 ));do cur="${1}"; @@ -121,7 +122,7 @@ EOM # UPDATE SOPS CONFIG # TODO: remove the 'pushd;popd' workaround and make the functions aware of the dir being read pushd "${keyfiles_dir}" > /dev/null 2>&1 -if [[ "${opt_list_roles}" ]]; then +if [[ "${opt_list_roles}" -eq 1 ]]; then pushd "${roles_def_dir}" > /dev/null 2>&1 >&2 echo "# INFO: listing roles" ls -1d *