-
-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure admin_user can connect before disabling root #345
Conversation
- name: Fail if root login will be disabled but admin_user cannot connect | ||
fail: | ||
msg: 'Halting playbook before disabling root login (`sshd_permit_root_login: false`) because the admin_user appears unable to connect. Ensure that the admin_user appears in your `users` hash with a valid entry for `keys`.' | ||
when: not sshd_permit_root_login and admin_user_status.rc != 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when: not sshd_permit_root_login and admin_user_status|failed
Think that's the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Thanks. I'll use that instead.
4b0963b
to
fa4ca7f
Compare
I added a commit with adjustments to handle this scenario: Imagine root login was disabled on a previous run of However, the check for whether admin_user can connect to the server must be run later, after the "Add SSH keys" task. So, our checks for Note that it might be more convenient to users if the |
703a7b0
to
dc38856
Compare
@fullyint squash + CHANGELOG update? Looks good 👍 |
dc38856
to
0f69090
Compare
updated CHANGELOG and squashed |
0f69090
to
b2966ce
Compare
Ensure admin_user can connect before disabling root
Resolves #294
Only merge after #344 which converts
sshd_permit_root_login
to boolean.