Interview Prep/Ansible/Cloud, AWX, Windows and Molecule

Using the SSM connection plugin fails with `SessionManagerPlugin is not found` or hangs on file transfer

AdvancedTroubleshootingCloud, AWX, Windows and Molecule
Answer

Likely causes →

  • The AWS session-manager-plugin binary is not installed on the controller or in the EE.
  • No ansible_aws_ssm_bucket_name is set. The plugin moves module files through S3, so a bucket is required.
  • The instance role lacks AmazonSSMManagedInstanceCore or access to that bucket.
  • The bucket is in a different region than the instance.

Diagnose →

session-manager-plugin --version
aws ssm describe-instance-information --query 'InstanceInformationList[].InstanceId'

Fix →

ansible_connection: amazon.aws.aws_ssm     # community.aws.aws_ssm on older collections
ansible_aws_ssm_region: ap-south-1
ansible_aws_ssm_bucket_name: acme-ansible-ssm-ap-south-1

Install the plugin into the EE image, and grant the instance role s3:GetObject and s3:PutObject on the bucket.

Prevent → Provision the bucket, the IAM roles and the SSM agent with Terraform as part of the base image or module.

All Ansible questions Roadmap: Ansible

More on Cloud, AWX, Windows and Molecule