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-pluginbinary is not installed on the controller or in the EE. - No
ansible_aws_ssm_bucket_nameis set. The plugin moves module files through S3, so a bucket is required. - The instance role lacks
AmazonSSMManagedInstanceCoreor 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.
More on Cloud, AWX, Windows and Molecule
`Failed to import the required Python library (botocore and boto3) on web01's Python /usr/bin/python3.`Beginner`[WARNING]: * Failed to parse inventory/aws.yml with auto plugin: inventory source 'inventory/aws.yml' could not be verified by inventory plugin 'amazon.aws.aws_ec2'`IntermediateThe `aws_ec2` inventory parses without errors but returns zero hostsIntermediate`Failed to describe instances: An error occurred (UnauthorizedOperation) when calling the DescribeInstances operation` or `(ExpiredToken)`IntermediateDynamic inventory finds the instances, but every host is `UNREACHABLE`Intermediate`winrm or requests is not installed: No module named 'winrm'`Beginner