
[aws_ssm_linux]
{% if instance_output | default(False) %}
{% if ( ami_configuration.os_type | default("linux")) == "linux" %}
linux_{{ instance_output.instance_ids[0] }} ansible_aws_ssm_instance_id={{ instance_output.instance_ids[0] }} ansible_aws_ssm_region={{ aws_region }}
{% endif %}
{% endif %}

[aws_ssm_windows]
{% if instance_output | default(False) %}
{% if ( ami_configuration.os_type | default("linux")) == "windows" %}
windows_{{ instance_output.instance_ids[0] }} ansible_aws_ssm_instance_id={{ instance_output.instance_ids[0] }} ansible_aws_ssm_region={{ aws_region }}
{% endif %}
{% endif %}

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

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

[aws_ssm:children]
aws_ssm_linux
aws_ssm_windows

[aws_ssm:vars]
ansible_connection=amazon.aws.aws_ssm
ansible_aws_ssm_plugin=/usr/local/sessionmanagerplugin/bin/session-manager-plugin
ansible_python_interpreter={{ os_python_path | default('/usr/bin/python3') }}
local_tmp=/tmp/ansible-local-{{ tiny_prefix }}
ansible_aws_ssm_bucket_name={{ s3_bucket_name }}
{% if s3_addressing_style | default(False) %}
ansible_aws_ssm_s3_addressing_style={{ s3_addressing_style }}
{% endif %}
{% if encrypted_bucket | default(False) %}
{% if not (s3_bucket_encryption | default(False)) %}
ansible_aws_ssm_bucket_sse_mode='aws:kms'
ansible_aws_ssm_bucket_sse_kms_key_id=alias/{{ kms_key_name }}
{% endif %}
{% endif %}
{% if use_ssm_document | default(False) %}
ansible_aws_ssm_document={{ ssm_document_name }}
{% endif %}
{% if endpoint_url | default(False) %}
ansible_aws_ssm_bucket_endpoint_url={{ endpoint_url }}
{% endif %}
{% if credential_vars | default(False) %}
ansible_aws_ssm_access_key_id='{{ aws_access_key }}'
ansible_aws_ssm_secret_access_key='{{aws_secret_key }}'
{% if security_token is defined %}
ansible_aws_ssm_session_token='{{ security_token }}'
{% endif %}
{% endif %}
{% if profile_name | default(False) %}
ansible_aws_ssm_profile={{ profile_name }}
{% endif %}

# support tests that target testhost
[testhost:children]
aws_ssm
