From a871e6e6f3e31b83986cb21d2a697c9df3e0889a Mon Sep 17 00:00:00 2001 From: William Mantly Date: Thu, 5 Mar 2026 16:39:10 -0500 Subject: [PATCH] migration --- index.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/index.sh b/index.sh index 5a26054..3e24917 100755 --- a/index.sh +++ b/index.sh @@ -13,7 +13,7 @@ export current_host=$(hostname) # Install SSSD and required tools # We use sssd-ldap for the backend and libnss-sss/libpam-sss for the system hooks DEBIAN_FRONTEND=noninteractive apt update -DEBIAN_FRONTEND=noninteractive apt install -y sssd sssd-ldap libnss-sss libpam-sss ldap-utils libsss-sudo curl libsasl2-modules-gssapi-mit +DEBIAN_FRONTEND=noninteractive apt install -y sudo sssd sssd-ldap libnss-sss libpam-sss ldap-utils libsss-sudo curl libsasl2-modules-gssapi-mit # Create the SSSD configuration from template mkdir -p /etc/sssd @@ -52,5 +52,17 @@ systemctl enable --now sssd-sudo.socket # --- SSO Group Creation API Calls --- if [[ -v sso_token ]]; then echo "Registering host groups via API..." - # (Existing curl logic remains here) + echo "found token" + curl "${sso_url}/api/group/" \ + -H "auth-token: ${sso_token}" \ + -H "content-type: application/json; charset=UTF-8" \ + --data-binary "{\"name\":\"host_${current_host}_access\",\"description\":\"Access for $current_host\"}" + + curl "${sso_url}/api/group/" \ + -H "auth-token: ${sso_token}" \ + -H "content-type: application/json; charset=UTF-8" \ + --data-binary "{\"name\":\"host_${current_host}_admin\",\"description\":\"sudo for $current_host\"}" fi + +echo "--- SSSD Migration Complete! ---" +echo "Please verify authentication and user access." \ No newline at end of file -- 2.34.1