Skip to content

Commit

Permalink
Update connection/aws_ssm documentation (#2234)
Browse files Browse the repository at this point in the history
SUMMARY

add a playbook to transfer file and run script into SSM managed node
Closes #1012

ISSUE TYPE

Docs Pull Request

COMPONENT NAME

connection/aws_ssm

Reviewed-by: GomathiselviS <gomathiselvi@gmail.com>
Reviewed-by: Mark Chappell
Reviewed-by: Markus Bergholz <git@osuv.de>
(cherry picked from commit ac2ca02)
  • Loading branch information
abikouo authored and patchback[bot] committed Feb 7, 2025
1 parent b7690aa commit 3088663
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions plugins/connection/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,38 @@
yum:
name: nginx
state: present
---
# Execution: ansible-playbook play.yaml -i ssm_inventory.ini
# =====================================================
# ssm_inventory.ini
# [all]
# linux ansible_aws_ssm_instance_id=i-01234567829abcdef ansible_aws_ssm_region=us-east-1
# [all:vars]
# ansible_connection=community.aws.aws_ssm
# ansible_python_interpreter=/usr/bin/python3
# local_tmp=/tmp/ansible-local-ssm-0123456
# ansible_aws_ssm_bucket_name=my-test-bucket
# ansible_aws_ssm_s3_addressing_style=virtual
# -----------------------
# Transfer file and run script on remote host
- name: Transfer file and Run script into SSM manage node
hosts: all
gather_facts: false
tasks:
- name: Create shell script
ansible.builtin.copy:
mode: '0755'
dest: '/tmp/date.sh'
content: |
#!/usr/bin/env bash
date
- name: Execute script from remote host
ansible.builtin.shell:
cmd: '/tmp/date.sh'
"""
import getpass
import json
Expand Down

0 comments on commit 3088663

Please sign in to comment.