issue #164: verify remote_tmp respected by code running remotely.

pull/193/head
David Wilson 6 years ago
parent e0381606af
commit aa8d7a0250

@ -7,6 +7,9 @@ library = modules
retry_files_enabled = False
forks = 50
# Required by runner__remote_tmp.yml
remote_tmp = ~/.ansible/mitogen-tests/
[ssh_connection]
ssh_args = -o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s
pipelining = True

@ -0,0 +1,19 @@
#!/bin/bash
# I am an Ansible WANT_JSON module that returns the paths to its argv[0] and
# args file.
INPUT="$1"
[ ! -r "$INPUT" ] && {
echo "Usage: $0 <input_file.json>" >&2
exit 1
}
echo "{"
echo " \"changed\": false,"
echo " \"msg\": \"Here is my input\","
echo " \"input\": [$(< $INPUT)],"
echo " \"argv0\": \"$0\","
echo " \"argv1\": \"$1\""
echo "}"

@ -9,3 +9,4 @@
- import_playbook: runner__custom_python_json_args_module.yml
- import_playbook: runner__custom_python_new_style_module.yml
- import_playbook: runner__custom_python_want_json_module.yml
- import_playbook: runner__remote_tmp.yml

@ -0,0 +1,16 @@
#
# The ansible.cfg remote_tmp setting should be copied to the target and used
# when generating temporary paths created by the runner.py code executing
# remotely.
#
- hosts: all
gather_facts: true
tasks:
- bash_return_paths:
register: output
- assert:
that: output.argv0.startswith('%s/.ansible/mitogen-tests/' % ansible_user_dir)
- assert:
that: output.argv1.startswith('%s/.ansible/mitogen-tests/' % ansible_user_dir)
Loading…
Cancel
Save