Skip to content

Commit 1fa67d8

Browse files
authored
Fix: Improve aws_ssm documentation examples (ansible-collections#2661)
SUMMARY I noticed that unlike aws_ec2 docs, aws_ssm connection plugin documentation doesn't mention ability to use compose to show one hostname, but connect to instance_id. I think it would be useful to add this. Fixes: ansible-collections#2652 ISSUE TYPE Docs Pull Request COMPONENT NAME ADDITIONAL INFORMATION None Reviewed-by: Mark Chappell Reviewed-by: Nicolai Antiferov Reviewed-by: Alina Buzachis Reviewed-by: GomathiselviS <gomathiselvi@gmail.com>
1 parent e8b801a commit 1fa67d8

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

plugins/connection/aws_ssm.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,20 @@
232232
raw: yum install -y awscli
233233
tags: aws-cli
234234
235+
# Alternatively, you can use a tag (eg. Name) as hostname instead of InstanceID.
236+
# However, "ansible_host" must still be set to the instance_id
237+
# =======================================
238+
# # aws_ec2.yml (Dynamic Inventory - Linux)
239+
# plugin: aws_ec2
240+
# regions:
241+
# - us-east-1
242+
# hostnames:
243+
# - tag:Name # will return `tag:Name` for hostname
244+
# compose:
245+
# ansible_host: instance_id # but connection will be done to InstanceID
235246
---
236247
237-
# Execution: ansible-playbook linux.yaml -i aws_ec2.yml
248+
# Execution: ansible-playbook windows.yaml -i aws_ec2.yml
238249
# =====================================================
239250
# # aws_ec2.yml (Dynamic Inventory - Windows)
240251
# plugin: aws_ec2

0 commit comments

Comments
 (0)