You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
155 lines
4.8 KiB
YAML
155 lines
4.8 KiB
YAML
|
|
# 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, ansible_ssh_pass
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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
|
|
|
|
- name: ansible_ssh_user, wrong ansible_ssh_pass
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS
|
|
fail_msg: out={{out}}
|
|
when: is_mitogen
|
|
|
|
|
|
- name: ansible_user, ansible_ssh_pass
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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
|
|
|
|
- name: ansible_user, wrong ansible_ssh_pass
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS
|
|
fail_msg: out={{out}}
|
|
when: is_mitogen
|
|
|
|
|
|
- name: ansible_user, ansible_password
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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
|
|
|
|
- name: ansible_user, wrong ansible_password
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS
|
|
fail_msg: out={{out}}
|
|
when: is_mitogen
|
|
|
|
|
|
- name: setup ansible_ssh_private_key_file
|
|
shell: chmod 0600 ../data/docker/mitogen__has_sudo_pubkey.key
|
|
args:
|
|
chdir: ../..
|
|
|
|
- name: ansible_user, ansible_ssh_private_key_file
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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
|
|
|
|
- name: ansible_user, wrong ansible_ssh_private_key_file
|
|
shell: >
|
|
ANSIBLE_ANY_ERRORS_FATAL=false
|
|
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 # ansible.executor.task_queue_manager.TaskQueueManager.RUN_UNREACHABLE_HOSTS
|
|
fail_msg: out={{out}}
|
|
when: is_mitogen
|