Skip to content

Wait for sudo before ansible#410

Merged
mpagot merged 1 commit intoSUSE:mainfrom
BillAnastasiadis:sudocheckd
Nov 7, 2025
Merged

Wait for sudo before ansible#410
mpagot merged 1 commit intoSUSE:mainfrom
BillAnastasiadis:sudocheckd

Conversation

@BillAnastasiadis
Copy link
Copy Markdown
Collaborator

@BillAnastasiadis BillAnastasiadis commented Nov 7, 2025

This is a qesap gluescript version of #406: it adds a wait for user and sudoers being ready before running the ansible playbooks.

az+ec2 tests to make sure nothing breaks:

https://openqa.suse.de/tests/19849472
https://openqa.suse.de/tests/19849481

(check for sudo -n true in the serial terminal log)

@BillAnastasiadis BillAnastasiadis force-pushed the sudocheckd branch 4 times, most recently from 9b6cce0 to 7f56ba9 Compare November 7, 2025 11:24
Comment thread scripts/qesap/lib/cmds.py
f'{ansible_bin_paths["ansible"]} {ansible_common} all '
'-m shell '
"-a 'i=0; while [ $i -lt 35 ]; do sudo -n true && exit 0; sleep 5; i=$((i+1)); done; exit 1' "
'--ssh-extra-args="-l cloudadmin -o UpdateHostKeys=yes -o StrictHostKeyChecking=accept-new"'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this line is needed. This one is to let keys/host to be accepted. It is only needed for first command. Not needed in this second one.

Copy link
Copy Markdown
Collaborator

@lpalovsky lpalovsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Collaborator

@mpagot mpagot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mpagot mpagot merged commit 55d3714 into SUSE:main Nov 7, 2025
4 checks passed
Comment thread scripts/qesap/lib/cmds.py
f'{ansible_bin_paths["ansible"]} {ansible_common} all '
'-m shell '
"-a 'i=0; while [ $i -lt 35 ]; do sudo -n true && exit 0; sleep 5; i=$((i+1)); done; exit 1' "
'--ssh-extra-args="-l cloudadmin -o UpdateHostKeys=yes -o StrictHostKeyChecking=accept-new"'
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd really like to avoid hardcoding the username (cloudadmin) here ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants