Unset pw reset for new Fleet users

This commit is contained in:
Josh Brower
2021-11-17 17:06:01 -05:00
parent 773c580e77
commit 5f3601ac78
2 changed files with 15 additions and 4 deletions

View File

@@ -32,6 +32,7 @@ fi
USER_EMAIL=$1
FLEET_SA_EMAIL=$(lookup_pillar_secret fleet_sa_email)
FLEET_SA_PW=$(lookup_pillar_secret fleet_sa_password)
MYSQL_PW=$(lookup_pillar_secret mysql)
# Read password for new user from stdin
test -t 0
@@ -61,4 +62,8 @@ else
echo "Unable to add user to Fleet; user might already exist"
echo "$CREATE_OUTPUT"
exit 2
fi
fi
# Disable forced password reset
MYSQL_OUTPUT=$(docker exec so-mysql mysql -u root --password=$MYSQL_PW fleet -e \
"UPDATE users SET admin_forced_password_reset = 0 WHERE email = '$USER_EMAIL'" 2>&1)