File: variables.yml

package info (click to toggle)
python-mitogen 0.3.3-9%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,816 kB
  • sloc: python: 22,086; sh: 171; makefile: 74; perl: 19; ansic: 18; javascript: 5
file content (139 lines) | stat: -rw-r--r-- 4,067 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

# These tests don't run on vanilla because ssh-askpass wants to run for
# whatever reason.

- name: integration/ssh/variables.yml
  hosts: test-targets[0]
  connection: local
  vars:
    # ControlMaster has the effect of caching the previous auth to the same
    # account, so disable it. Can't disable with ControlMaster no since that
    # already appears on command line, so override ControlPath with junk.
    ansible_ssh_common_args: |
      -o "ControlPath /tmp/mitogen-ansible-test-{{18446744073709551615|random}}"

  tasks:
    - name: ansible_ssh_user
      # Remaining tests just use "ansible_user".
      shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_ssh_user=mitogen__has_sudo
        -e ansible_ssh_pass=has_sudo_password
      args:
        chdir: ../..
      register: out
      when: is_mitogen

    - shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_ssh_user=mitogen__has_sudo
        -e ansible_ssh_pass=wrong_password
      args:
        chdir: ../..
      register: out
      ignore_errors: true
      when: is_mitogen

    - assert:
        that: out.rc == 4  # unreachable
        fail_msg: out={{out}}
      when: is_mitogen


    - name: ansible_ssh_pass
      shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo
        -e ansible_ssh_pass=has_sudo_password
      args:
        chdir: ../..
      register: out
      when: is_mitogen

    - shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo
        -e ansible_ssh_pass=wrong_password
      args:
        chdir: ../..
      register: out
      ignore_errors: true
      when: is_mitogen

    - assert:
        that: out.rc == 4  # unreachable
        fail_msg: out={{out}}
      when: is_mitogen


    - name: ansible_password
      shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo
        -e ansible_password=has_sudo_password
      args:
        chdir: ../..
      register: out
      when: is_mitogen

    - shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo
        -e ansible_password=wrong_password
      args:
        chdir: ../..
      register: out
      ignore_errors: true
      when: is_mitogen

    - assert:
        that: out.rc == 4  # unreachable
        fail_msg: out={{out}}
      when: is_mitogen


    - name: ansible_ssh_private_key_file
      shell: chmod 0600 ../data/docker/mitogen__has_sudo_pubkey.key
      args:
        chdir: ../..

    - name: ansible_ssh_private_key_file
      shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo_pubkey
        -e ansible_ssh_private_key_file=../data/docker/mitogen__has_sudo_pubkey.key
      args:
        chdir: ../..
      register: out
      when: is_mitogen

    - shell: >
        ANSIBLE_STRATEGY=mitogen_linear
        ANSIBLE_SSH_ARGS=""
        ansible -m shell -a whoami -i "{{MITOGEN_INVENTORY_FILE}}" test-targets
        -e ansible_user=mitogen__has_sudo
        -e ansible_ssh_private_key_file=/dev/null
      args:
        chdir: ../..
      register: out
      ignore_errors: true
      when: is_mitogen

    - assert:
        that: out.rc == 4  # unreachable
        fail_msg: out={{out}}
      when: is_mitogen