Skip to content

Commit 2c02648

Browse files
committed
Add regression test for issue 1232
1 parent cc544d4 commit 2c02648

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/ansible/regression/all.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
- import_playbook: issue_655__wait_for_connection_error.yml
1616
- import_playbook: issue_776__load_plugins_called_twice.yml
1717
- import_playbook: issue_952__ask_become_pass.yml
18+
- import_playbook: issue_1232__fully_qualified_names_become_method.yml
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
- name: regression/issue_1232__fully_qualified_names_become_method.yml (1/2)
2+
hosts: test-targets
3+
become_method: ansible.builtin.sudo
4+
tasks:
5+
- name: Run a shell command with sudo root
6+
vars:
7+
ansible_become_pass: rootpassword
8+
ansible.builtin.command: whoami
9+
become: true
10+
become_user: root
11+
12+
- name: regression/issue_1232__fully_qualified_names_become_method.yml (2/2)
13+
hosts: test-targets
14+
become_method: ansible.builtin.su
15+
tasks:
16+
- name: Run a shell command with su mitogen__user1
17+
vars:
18+
ansible_become_pass: user1_password
19+
when:
20+
# https://github.com/ansible/ansible/pull/70785
21+
- ansible_facts.distribution not in ["MacOSX"]
22+
or ansible_version.full is version("2.11", ">=", strict=True)
23+
or is_mitogen
24+
ansible.builtin.command: whoami
25+
become: true
26+
become_user: mitogen__user1

0 commit comments

Comments
 (0)