File: reset_become.yml

package info (click to toggle)
python-mitogen 0.3.37-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,728 kB
  • sloc: python: 24,644; sh: 198; makefile: 74; perl: 19; ansic: 18
file content (62 lines) | stat: -rw-r--r-- 1,637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# issue #633: Connection.reset() should ignore "become", and apply to the login
# account.

- name: integration/connection/reset_become.yml
  hosts: test-targets
  become: true
  gather_facts: false
  tasks:
  - debug: msg="reset_become.yml skipped on Ansible<2.5.6"
    when:
      - ansible_version_major_minor_patch is version('2.5.6', '<', strict=True)

  - meta: end_play
    when:
      - ansible_version_major_minor_patch is version('2.5.6', '<', strict=True)

  - 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
      fail_msg: |
        become_acct={{ become_acct }}
        login_acct={{ login_acct }}

  - 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
      fail_msg: |
        become_acct={{ become_acct }}
        new_become_acct={{ new_become_acct }}

  - 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
      fail_msg: |
        login_acct={{ login_acct }}
        new_login_acct={{ new_login_acct }}
  tags:
    - reset_become