parent
f01f237e6d
commit
68d6e6bf34
@ -1 +1,2 @@
|
|||||||
- import_playbook: timeouts.yml
|
- import_playbook: timeouts.yml
|
||||||
|
- import_playbook: variables.yml
|
||||||
|
@ -0,0 +1,101 @@
|
|||||||
|
|
||||||
|
- name: integration/ssh/variables.yml
|
||||||
|
hosts: test-targets
|
||||||
|
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 "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_ssh_user=mitogen__has_sudo
|
||||||
|
-e ansible_ssh_pass=has_sudo_password
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_ssh_user=mitogen__has_sudo
|
||||||
|
-e ansible_ssh_pass=wrong_password
|
||||||
|
register: out
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: out.rc == 4 # unreachable
|
||||||
|
|
||||||
|
|
||||||
|
- name: ansible_ssh_pass
|
||||||
|
shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo
|
||||||
|
-e ansible_ssh_pass=has_sudo_password
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo
|
||||||
|
-e ansible_ssh_pass=wrong_password
|
||||||
|
register: out
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: out.rc == 4 # unreachable
|
||||||
|
|
||||||
|
|
||||||
|
- name: ansible_password
|
||||||
|
shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo
|
||||||
|
-e ansible_password=has_sudo_password
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo
|
||||||
|
-e ansible_password=wrong_password
|
||||||
|
register: out
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: out.rc == 4 # unreachable
|
||||||
|
|
||||||
|
|
||||||
|
- name: ansible_ssh_private_key_file
|
||||||
|
shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo_pubkey
|
||||||
|
-e ansible_ssh_private_key_file=../data/docker/mitogen__has_sudo_pubkey.key
|
||||||
|
register: out
|
||||||
|
|
||||||
|
- shell: >
|
||||||
|
ANSIBLE_STRATEGY=mitogen_linear
|
||||||
|
ANSIBLE_SSH_ARGS=""
|
||||||
|
ansible -m shell -a whoami -i "{{inventory_file}}" test-targets
|
||||||
|
-e ansible_user=mitogen__has_sudo
|
||||||
|
-e ansible_ssh_private_key_file=/dev/null
|
||||||
|
register: out
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that: out.rc == 4 # unreachable
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue