Skip to content

Commit

Permalink
Try running SSM connection tests in parallel.
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Nov 24, 2020
1 parent 0bce639 commit 90d758b
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion tests/integration/targets/connection/test_connection.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- hosts: "{{ target_hosts }}"
gather_facts: no
serial: 1
strategy: free
tasks:

### test wait_for_connection plugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,10 @@
name: "{{resource_prefix}}-aws-ssm-s3"
register: s3_output

- name: Create Inventory file for Linux host
- name: Create Inventory file
template:
dest: "{{playbook_dir}}/inventory-linux.aws_ssm"
src: inventory-linux.aws_ssm.j2

- name: Create Inventory file for Windows host
template:
dest: "{{playbook_dir}}/inventory-windows.aws_ssm"
src: inventory-windows.aws_ssm.j2
dest: "{{playbook_dir}}/ssm_inventory"
src: inventory-combined.aws_ssm.j2

- name: Create AWS Keys Environement
template:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[aws_ssm_linux]
linux_{{linux_output.instance_ids[0]}} ansible_aws_ssm_instance_id={{linux_output.instance_ids[0]}} ansible_aws_ssm_region={{aws_region}}

[aws_ssm_linux:vars]
remote_tmp=/tmp/ansible-remote
action_prefix=

[aws_ssm_windows]
windows_{{windows_output.instance_ids[0]}} ansible_aws_ssm_instance_id={{windows_output.instance_ids[0]}} ansible_aws_ssm_region={{aws_region}}

[aws_ssm_windows:vars]
ansible_shell_type=powershell
remote_tmp=c:/windows/temp/ansible-remote
action_prefix=win_

[aws_ssm:children]
aws_ssm_linux
aws_ssm_windows

[aws_ssm:vars]
ansible_connection=community.aws.aws_ssm
ansible_aws_ssm_bucket_name={{s3_output.name}}
ansible_aws_ssm_plugin=/usr/local/sessionmanagerplugin/bin/session-manager-plugin
ansible_python_interpreter=/usr/bin/env python

# support tests that target testhost
[testhost:children]
aws_ssm
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[aws_ssm]
[aws_ssm_linux]
{{linux_output.instance_ids[0]}} ansible_aws_ssm_instance_id={{linux_output.instance_ids[0]}} ansible_aws_ssm_region={{aws_region}}

[aws_ssm:vars]
[aws_ssm_linux:vars]
ansible_connection=community.aws.aws_ssm
ansible_aws_ssm_bucket_name={{s3_output.name}}
ansible_aws_ssm_plugin=/usr/local/sessionmanagerplugin/bin/session-manager-plugin
ansible_python_interpreter=/usr/bin/env python
remote_tmp=/tmp/ansible-remote
action_prefix=

[aws_ssm:children]
aws_ssm_linux

# support tests that target testhost
[testhost:children]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
[aws_ssm]
[aws_ssm_windows]
{{windows_output.instance_ids[0]}} ansible_aws_ssm_instance_id={{windows_output.instance_ids[0]}} ansible_aws_ssm_region={{aws_region}}

[aws_ssm:vars]
[aws_ssm_windows:vars]
ansible_shell_type=powershell
ansible_connection=community.aws.aws_ssm
ansible_aws_ssm_bucket_name={{s3_output.name}}
ansible_aws_ssm_plugin=/usr/local/sessionmanagerplugin/bin/session-manager-plugin
remote_tmp=c:/windows/temp/ansible-remote
action_prefix=win_

[aws_ssm:children]
aws_ssm_linux

# support tests that target testhost
[testhost:children]
Expand Down

This file was deleted.

14 changes: 2 additions & 12 deletions tests/integration/targets/connection_aws_ssm/runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,8 @@ set -x

cd ../connection

# Execute Integration tests for Linux
INVENTORY=../connection_aws_ssm/inventory-linux.aws_ssm ./test.sh \
# Execute Integration tests
INVENTORY=../connection_aws_ssm/ssm_inventory ./test.sh \
-e target_hosts=aws_ssm \
-e local_tmp=/tmp/ansible-local \
-e remote_tmp=/tmp/ansible-remote \
-e action_prefix= \
"$@"

# Execute Integration tests for Windows
INVENTORY=../connection_aws_ssm/inventory-windows.aws_ssm ./test.sh \
-e target_hosts=aws_ssm \
-e local_tmp=/tmp/ansible-local \
-e remote_tmp=c:/windows/temp/ansible-remote \
-e action_prefix=win_ \
"$@"

0 comments on commit 90d758b

Please sign in to comment.