ostree-simplified-installer.sh: fix waiting loop for fdouser
`ssh grep fdouser /etc/passwd` returns 1 if the user doesn't exist yet. We run this script with set -euo pipefail, which cause the script to exit immediately. Thus, the waiting loop isn't actually waiting for anything. By adding `|| true`, we ensure that the loop is indeed waiting for the fdouser to be available. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
25161a8316
commit
156c411836
1 changed files with 2 additions and 2 deletions
|
|
@ -17,7 +17,7 @@ sudo pip3 install yq==v3.2.1
|
||||||
sudo dnf install -y fdo-admin-cli
|
sudo dnf install -y fdo-admin-cli
|
||||||
# Start fdo-aio to have /etc/fdo/aio folder
|
# Start fdo-aio to have /etc/fdo/aio folder
|
||||||
sudo systemctl enable --now fdo-aio
|
sudo systemctl enable --now fdo-aio
|
||||||
# Prepare service api server config file
|
# Prepare service api server config filef
|
||||||
sudo /usr/local/bin/yq -iy '.service_info.diskencryption_clevis |= [{disk_label: "/dev/vda4", reencrypt: true, binding: {pin: "tpm2", config: "{}"}}]' /etc/fdo/aio/configs/serviceinfo_api_server.yml
|
sudo /usr/local/bin/yq -iy '.service_info.diskencryption_clevis |= [{disk_label: "/dev/vda4", reencrypt: true, binding: {pin: "tpm2", config: "{}"}}]' /etc/fdo/aio/configs/serviceinfo_api_server.yml
|
||||||
sudo systemctl restart fdo-aio
|
sudo systemctl restart fdo-aio
|
||||||
|
|
||||||
|
|
@ -668,7 +668,7 @@ done
|
||||||
if [[ "${ANSIBLE_USER}" == "fdouser" ]]; then
|
if [[ "${ANSIBLE_USER}" == "fdouser" ]]; then
|
||||||
greenprint "🕹 Check if user 'fdouser' exist in edge vm"
|
greenprint "🕹 Check if user 'fdouser' exist in edge vm"
|
||||||
for _ in $(seq 0 30); do
|
for _ in $(seq 0 30); do
|
||||||
FDOUSER_EXIST=$(ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@$PUB_KEY_GUEST_ADDRESS "grep fdouser /etc/passwd")
|
FDOUSER_EXIST=$(ssh "${SSH_OPTIONS[@]}" -i "${SSH_KEY}" admin@$PUB_KEY_GUEST_ADDRESS "grep fdouser /etc/passwd || true")
|
||||||
if [[ ${FDOUSER_EXIST} =~ "fdouser" ]]; then
|
if [[ ${FDOUSER_EXIST} =~ "fdouser" ]]; then
|
||||||
echo "fdouser has been created"
|
echo "fdouser has been created"
|
||||||
break
|
break
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue