-
Notifications
You must be signed in to change notification settings - Fork 199
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
- import_playbook: issue_109__target_has_old_ansible_installed.yml | ||
- import_playbook: issue_113__duplicate_module_imports.yml | ||
- import_playbook: issue_118__script_not_marked_exec.yml | ||
- import_playbook: issue_122__environment_difference.yml | ||
- import_playbook: issue_140__thread_pileup.yml | ||
- import_playbook: issue_152__local_action_wrong_interpreter.yml | ||
- import_playbook: issue_152__virtualenv_python_fails.yml | ||
- import_playbook: issue_154__module_state_leaks.yml | ||
- import_playbook: issue_177__copy_module_failing.yml | ||
- import_playbook: issue_332_ansiblemoduleerror_first_occurrence.yml | ||
- import_playbook: issue_558_unarchive_failed.yml | ||
- import_playbook: issue_590__sys_modules_crap.yml | ||
- import_playbook: issue_591__setuptools_cwd_crash.yml | ||
- import_playbook: issue_615__streaming_transfer.yml | ||
- import_playbook: issue_655__wait_for_connection_error.yml | ||
- import_playbook: issue_766__get_with_context.yml | ||
- import_playbook: issue_776__load_plugins_called_twice.yml | ||
- import_playbook: issue_952__ask_become_pass.yml | ||
- import_playbook: issue_1066__add_host__host_key_checking.yml | ||
- import_playbook: issue_1079__wait_for_connection_timeout.yml | ||
- import_playbook: issue_1087__template_streamerror.yml | ||
- import_playbook: issue_1232__fully_qualified_names_become_method.yml |
73 changes: 62 additions & 11 deletions
73
tests/ansible/regression/issue_1232__fully_qualified_names_become_method.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,74 @@ | ||
- name: regression/issue_1232__fully_qualified_names_become_method.yml (1/2) | ||
- name: regression/issue_1232__fully_qualified_names_become_method.yml (1/3) | ||
hosts: test-targets | ||
become_method: ansible.builtin.sudo | ||
# become_method: ansible.builtin.sudo | ||
become_method: sudo | ||
tasks: | ||
- name: Run a shell command with sudo root | ||
vars: | ||
ansible_become_pass: rootpassword | ||
ansible.builtin.command: whoami | ||
- name: Test FQCN sudo, passwordless | ||
become: true | ||
become_user: root | ||
command: | ||
cmd: whoami | ||
register: fqcn_sudo_passwordless_whoami | ||
changed_when: false | ||
|
||
- assert: | ||
that: | ||
- fqcn_sudo_passwordless_whoami.stdout == 'root' | ||
fail_msg: | | ||
fqcn_sudo_passwordless_whoami={{ fqcn_sudo_passwordless_whoami }} | ||
tags: | ||
- sudo | ||
|
||
- name: regression/issue_1232__fully_qualified_names_become_method.yml (2/2) | ||
- name: regression/issue_1232__fully_qualified_names_become_method.yml (2/3) | ||
hosts: test-targets | ||
become_method: ansible.builtin.su | ||
# become_method: ansible.builtin.sudo | ||
become_method: sudo | ||
tasks: | ||
- name: Run a shell command with su mitogen__user1 | ||
- name: Test FQCN sudo, password required | ||
become: true | ||
become_user: mitogen__pw_required | ||
vars: | ||
ansible_become_pass: user1_password | ||
ansible_become_pass: pw_required_password | ||
command: | ||
cmd: whoami | ||
register: fqcn_sudo_password_whoami | ||
changed_when: false | ||
when: | ||
- become_unpriv_available | ||
ansible.builtin.command: whoami | ||
|
||
- assert: | ||
that: | ||
- fqcn_sudo_password_whoami.stdout == 'mitogen__pw_required' | ||
fail_msg: | | ||
fqcn_sudo_password_whoami={{ fqcn_sudo_password_whoami }} | ||
when: | ||
- become_unpriv_available | ||
tags: | ||
- sudo | ||
|
||
- name: regression/issue_1232__fully_qualified_names_become_method.yml (3/3) | ||
hosts: test-targets | ||
# become_method: ansible.builtin.su | ||
become_method: su | ||
tasks: | ||
- name: Test FQCN su, password required | ||
become: true | ||
become_user: mitogen__user1 | ||
vars: | ||
ansible_become_pass: user1_password | ||
command: | ||
cmd: whoami | ||
register: fqcn_su_password_whoami | ||
changed_when: false | ||
when: | ||
- become_unpriv_available | ||
|
||
- assert: | ||
that: | ||
- fqcn_su_password_whoami.stdout == 'mitogen__user1' | ||
fail_msg: | | ||
fqcn_su_password_whoami={{ fqcn_su_password_whoami }} | ||
when: | ||
- become_unpriv_available | ||
tags: | ||
- su |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters