mirror of
https://github.com/ansible/ansible.git
synced 2026-08-02 00:22:14 +02:00
Recognize password failures for BusyBox su (#87060)
* Allow root to use sudo on managed Alpine VMs This fixes the become_su test on Alpine when running non-split. * Remove test user sudoers file when removing the user * Recognize password failures for BusyBox su
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- ansible-test - Allow root to use sudo on managed Alpine instances.
|
||||
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- su become plugin - Add recognition of password failure for BusyBox version of ``su``.
|
||||
@@ -104,7 +104,10 @@ class BecomeModule(BecomeBase):
|
||||
pipelining = False
|
||||
|
||||
# messages for detecting prompted password issues
|
||||
fail = ('Authentication failure',)
|
||||
fail = (
|
||||
'Authentication failure',
|
||||
'incorrect password', # BusyBox
|
||||
)
|
||||
|
||||
SU_PROMPT_LOCALIZATIONS = [
|
||||
'Password',
|
||||
|
||||
@@ -5,3 +5,8 @@
|
||||
remove: yes
|
||||
force: yes
|
||||
loop: "{{ delete_users }}"
|
||||
|
||||
- name: delete test user sudoers file
|
||||
file:
|
||||
path: '{{ sudoers_path ~ ".d/" ~ test_user_name }}'
|
||||
state: absent
|
||||
|
||||
@@ -12,3 +12,4 @@
|
||||
{{ test_user_name }} ALL=(ALL) {{"NOPASSWD: " if test_user_allow_sudo == "nopasswd" else ""}} ALL
|
||||
mode: '0440'
|
||||
dest: '{{ sudoers_path ~ ".d/" ~ test_user_name }}'
|
||||
notify: delete test user sudoers file
|
||||
|
||||
@@ -230,6 +230,9 @@ bootstrap_remote_alpine()
|
||||
&& break
|
||||
retry_or_fail
|
||||
done
|
||||
|
||||
# Allow root to use sudo to facilitate become testing as is done in other test environments.
|
||||
echo "root ALL=(ALL) ALL" > /etc/sudoers.d/root
|
||||
}
|
||||
|
||||
bootstrap_remote_fedora()
|
||||
|
||||
Reference in New Issue
Block a user