Closed eastridge-admins closed 9 months ago
Thanks for taking the time to open this issue.
This looks like a duplicate of #1756 please try upgrading to community.aws 7.1.0.
@tremble That did the trick it's working now. Thanks for the help!
I have the same issue.
community.aws 8.0.0
inventory (values redacted):
instance-name ansible_host=i-1234567890 ansible_connection=aws_ssm ansible_aws_ssm_region=eu-west-1 ansible_aws_ssm_profile=profile ansible_aws_ssm_bucket_name=bucket_name
command:
ansible -i inventory instance-name -m ping -vvvvv
error:
<i-123456789> EXEC: echo ~ubuntu
<i-123456789> _wrap_command:
'printf '%s\n' 'RGZrWnmddYCIcPkSEmczRrvgrp';
echo | echo ~ubuntu;
printf '\n%s\n%s\n' "$?" 'MnvXNiVCbxgLnDpgxnnhTZiswi';
'
<i-123456789> EXEC stdout line:
RGZrWnmddYCIcPkSEmczRrvgrp
<i-123456789> EXEC stdout line:
/home/ubuntu
<i-123456789> EXEC stdout line:
<i-123456789> EXEC stdout line:
0
<i-123456789> EXEC stdout line:
MnvXNiVCbxgLnDpgxnnhTZiswi
<i-123456789> POST_PROCESS:
/home/ubuntu
0
<i-123456789> POST_PROCESSED:
/home/ubuntu
<i-123456789> ssm_retry: (success) (0, '/home/ubuntu\r\r', '')
<i-123456789> EXEC: ( umask 77 && mkdir -p "` echo /home/ubuntu/.ansible/tmp `"&& mkdir "` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `" && echo ansible-tmp-1727455054.3445492-51980-98379523949974="` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `" )
<i-123456789> _wrap_command:
'printf '%s\n' 'zLNzInkYZFFCjAiCtvvtiHOaXV';
echo | ( umask 77 && mkdir -p "` echo /home/ubuntu/.ansible/tmp `"&& mkdir "` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `" && echo ansible-tmp-1727455054.3445492-51980-98379523949974="` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `" );
printf '\n%s\n%s\n' "$?" 'FQYPbSfkMFprbwBwCkBMfBotLr';
'
<i-123456789> EXEC stdout line:
zLNzInkYZFFCjAiCtvvtiHOaXV
<i-123456789> EXEC stdout line:
mkdir: cannot create directory ‘/home/ubuntu’: Permission denied
<i-123456789> EXEC stdout line:
<i-123456789> EXEC stdout line:
1
<i-123456789> EXEC stdout line:
FQYPbSfkMFprbwBwCkBMfBotLr
<i-123456789> POST_PROCESS:
mkdir: cannot create directory ‘/home/ubuntu’: Permission denied
1
<i-123456789> POST_PROCESSED:
mkdir: cannot create directory ‘/home/ubuntu’: Permission denied
<i-123456789> ssm_retry: (success) (1, 'mkdir: cannot create directory ‘/home/ubuntu’: Permission denied\r\r', '')
<i-123456789> CLOSING SSM CONNECTION TO: i-123456789
<i-123456789> TERMINATE SSM SESSION: User-Name-yg45vxdgipzb6r2us9nfdlfpsq
instance-name | UNREACHABLE! => {
"changed": false,
"msg": "Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /home/ubuntu/.ansible/tmp `\"&& mkdir \"` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `\" && echo ansible-tmp-1727455054.3445492-51980-98379523949974=\"` echo /home/ubuntu/.ansible/tmp/ansible-tmp-1727455054.3445492-51980-98379523949974 `\" ), exited with result 1, stdout output: mkdir: cannot create directory ‘/home/ubuntu’: Permission denied\r\r",
"unreachable": true
}
Summary
When running an ansible playbook using the following inventory file:
I am unable to connect to the server because and it gives the following error:
To give more context, when I run this playbook locally it runs successfully, but when I try to run this playbook from a docker container that has ansible and the plugins installed, it fails.
Issue Type
Bug Report
Component Name
aws_ssm
Ansible Version
Collection Versions
AWS SDK versions
Configuration
OS / Environment
Alpine
Steps to Reproduce
Expected Results
Actual Results
Code of Conduct