issue #633: handle meta: reset_connection when become is active
- don't create a new connection during reset if no existing connection exists - strip off last hop in connection stack if PlayContext.become is True. - log a debug message if reset cannot find an existing connectionpull/653/head
parent
b6d1df749c
commit
fc09b81949
@ -0,0 +1,42 @@
|
||||
# issue #633: Connection.reset() should ignore "become", and apply to the login
|
||||
# account.
|
||||
|
||||
- hosts: test-targets
|
||||
become: true
|
||||
gather_facts: false
|
||||
tasks:
|
||||
- name: save pid of the become acct
|
||||
custom_python_detect_environment:
|
||||
register: become_acct
|
||||
|
||||
- name: save pid of the login acct
|
||||
become: false
|
||||
custom_python_detect_environment:
|
||||
register: login_acct
|
||||
|
||||
- name: ensure login != become
|
||||
assert:
|
||||
that:
|
||||
- become_acct.pid != login_acct.pid
|
||||
|
||||
- name: reset the connection
|
||||
meta: reset_connection
|
||||
|
||||
- name: save new pid of the become acct
|
||||
custom_python_detect_environment:
|
||||
register: new_become_acct
|
||||
|
||||
- name: ensure become_acct != new_become_acct
|
||||
assert:
|
||||
that:
|
||||
- become_acct.pid != new_become_acct.pid
|
||||
|
||||
- name: save new pid of login acct
|
||||
become: false
|
||||
custom_python_detect_environment:
|
||||
register: new_login_acct
|
||||
|
||||
- name: ensure login_acct != new_login_acct
|
||||
assert:
|
||||
that:
|
||||
- login_acct.pid != new_login_acct.pid
|
Loading…
Reference in New Issue