forked from mitogen-hq/mitogen
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Test templating of ansible_ssh_common_args et al
refs mitogen-hq#905
- Loading branch information
Showing
6 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
- name: integration/ssh/args.yml | ||
hosts: issue905 | ||
gather_facts: false | ||
tasks: | ||
# Test that ansible_ssh_common_args are templated; ansible_ssh_args & | ||
# ansible_ssh_extra_args aren't directly tested, we assume they're similar. | ||
# FIXME This test currently relies on variables set in the host group. | ||
# Ideally they'd be set here, and the host group eliminated, but | ||
# Mitogen currently fails to template when defined in the play. | ||
# TODO Replace LocalCommand canary with SetEnv canary, to simplify test. | ||
# Requires modification of sshd_config files to add AcceptEnv ... | ||
- name: Test templating of ansible_ssh_common_args et al | ||
block: | ||
- name: Ensure no lingering canary files | ||
file: | ||
path: "{{ ssh_args_canary_file }}" | ||
state: absent | ||
delegate_to: localhost | ||
|
||
- name: Reset connections to force new ssh execution | ||
meta: reset_connection | ||
|
||
- name: Perform SSH connection, to trigger side effect | ||
ping: | ||
|
||
# LocalCommand="touch {{ ssh_args_canary_file }}" in ssh_*_args | ||
- name: Stat for canary file created by side effect | ||
stat: | ||
path: "{{ ssh_args_canary_file }}" | ||
delegate_to: localhost | ||
register: ssh_args_canary_stat | ||
|
||
- assert: | ||
that: | ||
- ssh_args_canary_stat.stat.exists == true | ||
quiet: true | ||
success_msg: "Canary found: {{ ssh_args_canary_file }}" | ||
fail_msg: | | ||
ssh_args_canary_file={{ ssh_args_canary_file }} | ||
ssh_args_canary_stat={{ ssh_args_canary_stat }} | ||
always: | ||
- name: Cleanup canary files | ||
file: | ||
path: "{{ ssh_args_canary_file }}" | ||
state: absent | ||
delegate_to: localhost | ||
tags: | ||
- issue_905 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters