File: become_flags.yml

package info (click to toggle)
python-mitogen 0.3.44-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,824 kB
  • sloc: python: 24,965; sh: 144; makefile: 74; perl: 19; ansic: 18
file content (36 lines) | stat: -rw-r--r-- 661 bytes parent folder | download | duplicates (3)
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
#
# Test sudo_flags respects -E.
#

- name: integration/playbook_semantics/become_flags.yml
  hosts: test-targets
  tasks:

    - name: "without -E"
      become: true
      shell: "echo $I_WAS_PRESERVED"
      register: out

    - assert:
        that: "out.stdout == ''"
        fail_msg: |
          out={{ out }}
  tags:
    - become_flags

- hosts: test-targets
  become_flags: -E
  tasks:
    - name: "with -E"
      become: true
      shell: "echo $I_WAS_PRESERVED"
      register: out2
      environment:
        I_WAS_PRESERVED: 2

    - assert:
        that: "out2.stdout == '2'"
        fail_msg: |
          out={{ out }}
  tags:
    - become_flags