-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ssm connection plugin fails at gathering facts #113
Comments
Same issue, unusual plugin |
I looked into this, and there are several things wrong I think. See this line cmd = "echo " + mark_start + "\n" + cmd + "\necho $'\\n'$?\n" + "echo " + mark_end + "\n" The shell used by the session-manager is
$ echo $'\n'$?
$
0
$ echo $'\n'$?
0 However, that might be a red herring. Notice the output:
That is the input commands, not the stdout. Where is the output? |
Here is a workaround that avoids --- a/plugins/connection/aws_ssm.py 2020-09-03 18:43:43.818000000 +0200
+++ b/plugins/connection/aws_ssm.py 2020-09-03 18:43:19.805000000 +0200
@@ -288,11 +288,17 @@
profile_name = ''
region_name = self.get_option('region')
- ssm_parameters = dict()
client = boto3.client('ssm', region_name=region_name)
self._client = client
- response = client.start_session(Target=self.instance_id, Parameters=ssm_parameters)
+
+ if self.is_windows:
+ ssm_parameters = dict()
+ response = client.start_session(Target=self.instance_id, Parameters=ssm_parameters)
+ else:
+ ssm_parameters = {"command": ["bash -l"]}
+ response = client.start_session(Target=self.instance_id, DocumentName="AWS-StartInteractiveCommand", Parameters=ssm_parameters)
+
self._session_id = response['SessionId']
cmd = [
|
…ctions#113) Avoid the use of sh and instead use bash directly.
…ctions#113) Avoid the use of sh and instead use bash directly.
…ctions#113) Avoid the use of sh and instead use bash directly.
I looked at this for a bit today and found that you were right to be skeptical @abeluck . The issue appears to actually be in Since the commands are sent so quickly, the terminal prints all lines. Then we break out of the loop because After removing the loop breakout:
After adding a 5 second delay
|
Would love to see these fixes land, and maybe get some tests around this plugin (not sure how that would work). We bailed on the ssm plugin for now and are running ansible over ssh over ssm, which means we still have to manage ssh keys on instances (though we don't need a bastion any longer). |
Another strange issue that i see related to this during gathering facts is the AnsiballZ_setup.py that is run does something to mess with the shell and always hits EXEC remaining and always times out after without echoing to stdout the new line and the end mark. My remote host is running an older version of python so I'm initially thinking thats related. Trying to stand up a venv on remote to use as env |
Here's a patch that I'm willing to contribute (haven't gotten a chance to set up a fork yet)
Problems I still see:
Anywho, I freely release the below under a GPL V3.0+ license like the files from which the were derived. I can look at figuring out the contributor agreement/etc later this week.
|
Im willing to try it because im stuck. My executing node is running py3. My endpoint is only running 2.7 (legacy os). So the plugin being py3 only should be fine. The py2 issues may just be with what ansible packages up and sends over to the endpoint |
@DanielFallon thanks for the patch. Had to change your ssm_timeout to timeout for the self.get_option call. upon executing im getting stuck in a PRE remaining loop eg prompt not ready during gathering facts |
The change in get_option call is because my patch was for the development version instead of the currently released version (they just changed it from timeout to ssm_timeout) can you post a redacted log with debug level at least 4? (-vvvv) There are sort of 3 phases:
second, waits to receive the string:
and the third wait's to receive a custom generated end string:
I expected this code to be a bit fragile but fail safe. Maybe I should add some more detail to the timeout exception |
I can grab you a log, but may take some time, my inventory script now isn't populating as expected which sets up the s3 bucket name, and instance id. |
it's also worth noting that I only tested this with a sort of hello world example. I wouldn't be surprised if there are still things that don't work. I do think that some sort of scripted regression testing would be very valuable for this as it is fragile and could be broken by:
all things to enumerate and test |
Does your patch apply to the 1.2 tagged release or on the main branch? |
Please see sanitized output. I took stock 1.2 and added just your patch and got the following
I also added the bash shell patch as well (but changed bash -l to bash --noprofile -l) with a similar result |
I modified some of the re's that are in the patch (mainly removing the \r\n's). Now I'm hitting the same issue. The AnsiballZ_setup.py gets transferred and executed. It prints out the json for the facts, but i never get the end mark. As in I never see the second printf output
Then back to the retry loop |
the bash patch is definitely incompatible with mine. (because the regex would definitely have to change.) does This is one of the things I was worried about in my comment above. I kind of want to look at some other connection plugins and see how they handle this, because I think a lot of pieces of this are pretty fragile and I want to see others ideas. maybe instead of clearing the prompt, we could set it to an end_mark so that the shell will print it. |
I tried both sh and bash (with and w/o modding the re's) and both have similar behavior. I do think that AnsiballZ_setup.py is doing something to stdin. |
This is not an SSM specific solution, but I'm tempted to try out using SendSSHPublicKey from the EC2 instance connect api and then wrapping the ssh connection library instead. Feels like it might be generally more stable (and would support sftp as well) SSM might still be necessary for the tunnel, but I'm not sure piping commands to stdin is ever really going to be partiuclarly stable. Any reason why ssmStartSession is superior that I should know about? |
Looking at this a bit closer, it looks like the right way to address this if use of SSM is wanted is to add a parameter like Because customization of the shell is so fragile, it's probably worthwhile to provide a sane default and then allow users to override the --document-name provided to the session to configure things further. To facilitate this, the important part is to establish a protocol for communicating stdout and the exit code back to the client (preferably one that is slightly more robust than what is present now so that a user can always produce working results for their system) I'll give it another half an hour today and post results |
@DanielFallon would be interested to see your results. Seems to be a step in the right direction. |
I think this solution work partially, because is not closing the sessions in session manager. And the system open one session for every one task in Ansible. This causes if I execute a playbook with 10 tasks, 10 session is opening and no closing xd ... |
The above wont work if there is anything custom about the systems (or users) bash profile that changes what is presented on stdout. I've tried this even with --noprofile and it still hangs for me when gathering facts. |
I have the same issue with Debian e.g. ubuntu |
As a work-around you can switch default shell to |
As with @eliskovets , I had to change the default shell to bash, but I used the instructions at https://unix.stackexchange.com/questions/442510/how-to-use-bash-for-sh-in-ubuntu. |
For me, changing the shell using the profile in the Session Manager setting broke logins to Amazon Linux 2 for some reason (which was working OK before). What worked was changing the link that /bin/sh uses via the "sudo dpkg-reconfigure dash" command in Ubuntu. Thanks @eliskovets! |
Ran into the identical thing: https://stackoverflow.com/questions/68734815/ansible-aws-ssm-connectivity-plugin-ciphertext-refers-to-a-customer-master Does this warrant a separate bug? (Just confirmed while replicating that the default shell needed to NOT be |
(Update, moving away from dash has no immediate downside) Re: Changing the ubuntu default shell fix - ansible version
|
@bedge your vtype should be boolean and I don't think you should be quoting 'false'. I haven't tested with cloudinit yet but hopefully that's all you need to do. |
@jagibson Confirmed your suggestion os correct for the ansible (no) dash fix: # See "/var/cache/debconf/config.dat" for name of config item after changing manually
- name: aws-ssm ansible plugin fails if dash is the default shell
ansible.builtin.debconf:
name: dash/sh
question: dash/sh
value: false
vtype: boolean thanks Now the remaining issue is the s3 permissions. Seems to work only with {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}
]
} Any attempt to reign that in and it starts failing with:
Is there any way to restrict the s3 access to a specific bucket:///... ? |
After some unreliable success with dash removed as the default for /bin/sh on the targets, I switched to setting the |
Does this plugin work? 1st attempt:
2nd attempt:
|
Why isn't anyone using the fix here #583 ? It seems to work flawlessly for me. |
I found this problem occurs windows also. |
Fix ansible-collections#113 Apply diff proposed by thomas-anderson-bsl ansible-collections#113 (comment)
* Add some unit tests for ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict and compare_aws_tags * Change test name
workaround until ansible-collections#113 is fixed
Fix ansible-collections#113 Apply diff proposed by thomas-anderson-bsl ansible-collections#113 (comment)
fix ssm connection plugin fails at gathering facts SUMMARY Apply diff proposed by @thomas-anderson-bsl #113 (comment) Fix #113 Fix #1163 ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION Currently the example is failing on my Linux laptop [vagrant@centos8 test]$ env |grep AWS AWS_PROFILE=TKM_NOPROD AWS_DEFAULT_REGION=eu-west-3 AWS_SDK_LOAD_CONFIG=1 [vagrant@centos8 test]$ aws sts get-caller-identity { "UserId": "AROAQIIBQ3JCUSOU4JWCK:A512753", "Account": "017719941701", "Arn": "arn:aws:sts::017719941701:assumed-role/SysAdmin/A512753" } [vagrant@centos8 test]$ cat linux.yaml - name: install aws-cli hosts: all gather_facts: false vars: ansible_connection: aws_ssm ansible_aws_ssm_bucket_name: tkm-exported-logs ansible_aws_ssm_region: eu-west-3 tasks: - name: aws-cli raw: yum install -y awscli tags: aws-cli [vagrant@centos8 test]$ cat aws_ec2.yml plugin: aws_ec2 regions: - eu-west-3 hostnames: - instance-id filters: tag:SSMTag: ssmlinux [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 redirecting (type: connection) ansible.builtin.aws_ssm to community.aws.aws_ssm Loading collection community.aws from /home/vagrant/.local/lib/python3.6/site-packages/ansible_collections/community/aws <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0c292c1774b397c6f", "TokenValue": "AAEAAf79ujbqpQGYfHpLaJiTOlhUExBJDOkiLd/Fbq/alKF7AAAAAGCJEg4Fl3ljDMM9XwWJvAyTVsF3XwDlkJzbk4+c2802jl7gIIIODbDpCdsh9YRRLe5zIb1eXcZCTAquivDmzKpNp46ZxxRg/8UK/y5zeq8SvB58Fv8ir91F9LfxQD/hjVYOXKbU6MTjBeL7/JLCrWio5jV55NjXV1PMFWVVbfYvR+lesRhPKVhFf6bO4quyCTL+bmEDVAmCJnQX52KwBSqJhKArWUjAsmCfVj/YqaPLt1xmcR+CMlwO/x1VZPm6n2BBpFRr856bxsmVdEBOl/ckwsOK9k3JrTGQQuGxAVplO5rKlynBD15h2J4/CX1f2RiPOQghLyLSOUaSMA/o0MJMFkD7vMztgswj91lTqJKEu5O5fV1/3s1FnqRrXfFV6/+tcECoaDPxqbPvBiouN+5HHw4S", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0c292c1774b397c6f?role=publish_subscribe", "ResponseMetadata": {"RequestId": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:43:10 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo MjGohIiJUEeYoYWfZIfzrUfbLg sudo yum install -y awscli echo $'\n'$? echo YoJSNqxmpcVfcJGJRJVfIteacP ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ MjGohIiJUEeYoYWfZIfzrUfbLg <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 57 <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 0, cmd (yum install -y awscli...), pausing for 0 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0c292c1774b397c6f <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0d6533239e4db8272", "TokenValue": "AAEAAcua+Crf0t+FmSNgvZSpxTvDQksaWVQiDjJ96ZmNStp0AAAAAGCJEkzdO6ZTkt7WRjUVePEQ7dys7SUGc/Ys8sPyn9r/gKqfi9g84j8uc6HaLKbB/jmrdVSdGMBVNvDEZtgeSpJMSRqZ/jPjB9jW0RHXCia8161lzpG6mnACyoL/bt6l1zpXA98sa4NFbaBRATXP+Rwd+gNONSn40kLYWegp/hvnsCgRsE70FfSrH+9NNsCpNvMli1TexqTuoQB1xz7MUnsMEwc/kkHM8NDcpEH+AGbNbVlSy3pLVe2EPS0ps2ElPp9WKpMrkywhN2LZT510TgRK6UoS23QBp2ZxqNPZLgK/qZh91M++pXYX/kBX5ACpOdBSccyMyHMN+aO//690zfC7Glk6t+i68R9odMFesPrDGPeWvhfZvtEuxW6TIOYLVqNOG7xR6/ilcGir7wrHNLvAmw4M", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0d6533239e4db8272?role=publish_subscribe", "ResponseMetadata": {"RequestId": "48b9d452-99da-4b4d-9e30-148c4648760e", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:44:12 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "48b9d452-99da-4b4d-9e30-148c4648760e"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo AhNjLyNqKvKkPpDrBmFRWXQhYa sudo yum install -y awscli echo $'\n'$? echo JuLdCBzespYaUSOaucFXezVwIt ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ AhNjLyNqKvKkPpDrBmFRWXQhYa <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 1, cmd (yum install -y awscli...), pausing for 1 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0d6533239e4db8272 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-09a773809c4290ba8", "TokenValue": "AAEAAY8euMXFMJqb6NktLar2duBd+N19wyEaDkoCkanNHU2RAAAAAGCJEoofW/XfRQ9bW2MlXFDd2V+3X2Dg9t1qHGvHkz8Ms1kHMZVNHAq4vk6YnulLLJmDf8GuBAbm1UpguJLbtdI1/dmWMXCSAHmAKwdCchds+eP4a0kBNWNCWRpa4g5igD6t+gwJNqtYFgfofbUJ1tPYenBUHtP/iYaWloP9NKXMDlcxB80mIc0jhWdK7IM+ohztD4HHWz9YLjw/yTrnUjTVMoLgoVAYp+42knhG5DYxXW6l5R6j2KUdGCgCsPmiQog9rZnpG1FR9Tr3+EpuEQhxZ4jRQA7Oez12KE1TMCcp5y22pg1i2tZ5bSu+NreIBmorVTay0RSoGtVCIGvcFs0T3UIQZQtlGwNhwpbOFqyT50d6N99zw7chzv5ORi3ilmweSIEqbUFTaCfCGxy7bOX+br5z", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-09a773809c4290ba8?role=publish_subscribe", "ResponseMetadata": {"RequestId": "6f105bd2-61c4-49b3-92b5-64b71149161d", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:45:14 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "6f105bd2-61c4-49b3-92b5-64b71149161d"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo fxUMwVtRygloIfujoykKZqsRYQ sudo yum install -y awscli echo $'\n'$? echo meoFrFEeqnsFelOUcbgYMqWcqf ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ fxUMwVtRygloIfujoykKZqsRYQ <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 2, cmd (yum install -y awscli...), pausing for 3 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-09a773809c4290ba8 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-04ce28f1ed0a9b2cc", "TokenValue": "AAEAAWShVQvs4lr+jZzebJuPI/kjqeHN9aRbG8Ga+dDyG92JAAAAAGCJEsu8ji1RBCTYUF6gZuRvoNRCynBSdcj5DEXOx/aGcIvd9dhQ35CL3yqd6vc2SG3CfGuVDrzaPjXdqbSpK8vYeC8T6o1iqCQQZTWRjx3hv1JPNcIvqKToXnVNYEehyuqL9AiEwjsp4BKsj+1GyZaONSEhu3hGv7CaU0lLwsZSeLNx/gUo48QKJJdfUFhAfElnlyt/bLgAFNokPWfhJo9C8eJaGUbPjGx5q5fFajpbCt56XE6bMqdvDkQq0rL0CCVOa8OwcXrq1cixwj8zyVJRk4r1xFaxVJUrNSiZjBef8XnuIJSwJGS4rqW3xj7MAcN+fP37cwsvRDXzaJiaNIQixd4BMUJT9DKBTnt5k8CKlkig/1CkLiqRfpTt/1dDrk3ijIn+WmijmUIGzXGTASXf4NL4", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-04ce28f1ed0a9b2cc?role=publish_subscribe", "ResponseMetadata": {"RequestId": "079764cf-ef62-4378-a6a7-c1aa982b2175", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:46:19 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "079764cf-ef62-4378-a6a7-c1aa982b2175"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo mYEabajpUREmWopOVdtXWVjhjA sudo yum install -y awscli echo $'\n'$? echo HUOIrDSkTqNbXtGnpsfqUWmKse ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ mYEabajpUREmWopOVdtXWVjhjA <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-04ce28f1ed0a9b2cc fatal: [i-01a919b33286168b1]: UNREACHABLE! => { "changed": false, "msg": "SSM exec_command timeout on host: i-01a919b33286168b1", "unreachable": true } PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 When I apply the patch, it works well [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-03fc91cde78438694", "TokenValue": "AAEAAW/9pxZQ5rD36JpYalo7sawVweoKITNNtI4392BVkuEDAAAAAGCJE4m7i9Fiy79NAlD8WLAXo1Ybury4avfnW75u3V57mFHcOLF/NHkGHVrg9CgaddaKEdq46EmXmpnqL4BJ/bUzE6sm8YpX/JyLmxnuBaOMMfTEpBdTmTdEjJfq3JeRG3ze4klZwUAO3Bkr6Y4PebzPDSsiC9cYa/vF7JKWS05BR80j0eX3JrI02NQs6Xl4R12D88l80kxvhorMtSwdSuwVrfDJtVSX0AgRpDgc3ZaeoZOl6INJSz1joXdykO6J6sFNUorQwLYVOet8EgHRHSxes2rhWccZxsNWA4WDqLe4yJ53/aVfvEtAXrC5sB/dEdyh0HaT7e3xZJGgTLqkY8tPZ1t96ftCU4WCGyqcmsey6AHjY4pyKzspibjtb+3mQiFmhHVY2qXJdNm/GK8QiM3KvDNV", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-03fc91cde78438694?role=publish_subscribe", "ResponseMetadata": {"RequestId": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:49:29 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n' <i-01a919b33286168b1> PRE startup output received <i-01a919b33286168b1> PRE Disabling Echo: b'stty -echo\n' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ ' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ s' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ ' <i-01a919b33286168b1> PRE Disabling Prompt: b"PS1='' ; printf '\\n%s\\n' 'tzLzeOyQfgbHdOairfXctIHvCE'\n" <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ \r\r\ntzLzeOyQfgbHdOairfXctIHvCE\r\r\n' <i-01a919b33286168b1> PRE Terminal configured <i-01a919b33286168b1> SSM CONNECTION ID: A512753-03fc91cde78438694 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'printf '%s\n' 'unVADXWGDhKpmPYyJlyAahHsWK'; echo | sudo yum install -y awscli; printf '\n%s\n%s\n' "$?" 'swsasimtXIvBgCtvgOQifPBsrV'; ' <i-01a919b33286168b1> EXEC stdout line: unVADXWGDhKpmPYyJlyAahHsWK <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: 0 <i-01a919b33286168b1> EXEC stdout line: swsasimtXIvBgCtvgOQifPBsrV <i-01a919b33286168b1> POST_PROCESS: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do 0 <i-01a919b33286168b1> (0, 'Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r', '') <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-03fc91cde78438694 changed: [i-01a919b33286168b1] => { "changed": true, "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r", "stdout_lines": [ "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd", "", "", "", "amzn2-core | 3.7 kB 00:00 ", "", "", "332 packages excluded due to repository priority protections", "", "", "Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version", "", "", "Nothing to do", "", "" ] } META: ran handlers META: ran handlers PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 With the patch, it also works with gather_facts: true Reviewed-by: Mark Chappell <None> (cherry picked from commit a5b44b8)
fix ssm connection plugin fails at gathering facts SUMMARY Apply diff proposed by @thomas-anderson-bsl #113 (comment) Fix #113 Fix #1163 ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION Currently the example is failing on my Linux laptop [vagrant@centos8 test]$ env |grep AWS AWS_PROFILE=TKM_NOPROD AWS_DEFAULT_REGION=eu-west-3 AWS_SDK_LOAD_CONFIG=1 [vagrant@centos8 test]$ aws sts get-caller-identity { "UserId": "AROAQIIBQ3JCUSOU4JWCK:A512753", "Account": "017719941701", "Arn": "arn:aws:sts::017719941701:assumed-role/SysAdmin/A512753" } [vagrant@centos8 test]$ cat linux.yaml - name: install aws-cli hosts: all gather_facts: false vars: ansible_connection: aws_ssm ansible_aws_ssm_bucket_name: tkm-exported-logs ansible_aws_ssm_region: eu-west-3 tasks: - name: aws-cli raw: yum install -y awscli tags: aws-cli [vagrant@centos8 test]$ cat aws_ec2.yml plugin: aws_ec2 regions: - eu-west-3 hostnames: - instance-id filters: tag:SSMTag: ssmlinux [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 redirecting (type: connection) ansible.builtin.aws_ssm to community.aws.aws_ssm Loading collection community.aws from /home/vagrant/.local/lib/python3.6/site-packages/ansible_collections/community/aws <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0c292c1774b397c6f", "TokenValue": "AAEAAf79ujbqpQGYfHpLaJiTOlhUExBJDOkiLd/Fbq/alKF7AAAAAGCJEg4Fl3ljDMM9XwWJvAyTVsF3XwDlkJzbk4+c2802jl7gIIIODbDpCdsh9YRRLe5zIb1eXcZCTAquivDmzKpNp46ZxxRg/8UK/y5zeq8SvB58Fv8ir91F9LfxQD/hjVYOXKbU6MTjBeL7/JLCrWio5jV55NjXV1PMFWVVbfYvR+lesRhPKVhFf6bO4quyCTL+bmEDVAmCJnQX52KwBSqJhKArWUjAsmCfVj/YqaPLt1xmcR+CMlwO/x1VZPm6n2BBpFRr856bxsmVdEBOl/ckwsOK9k3JrTGQQuGxAVplO5rKlynBD15h2J4/CX1f2RiPOQghLyLSOUaSMA/o0MJMFkD7vMztgswj91lTqJKEu5O5fV1/3s1FnqRrXfFV6/+tcECoaDPxqbPvBiouN+5HHw4S", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0c292c1774b397c6f?role=publish_subscribe", "ResponseMetadata": {"RequestId": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:43:10 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo MjGohIiJUEeYoYWfZIfzrUfbLg sudo yum install -y awscli echo $'\n'$? echo YoJSNqxmpcVfcJGJRJVfIteacP ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ MjGohIiJUEeYoYWfZIfzrUfbLg <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 57 <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 0, cmd (yum install -y awscli...), pausing for 0 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0c292c1774b397c6f <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0d6533239e4db8272", "TokenValue": "AAEAAcua+Crf0t+FmSNgvZSpxTvDQksaWVQiDjJ96ZmNStp0AAAAAGCJEkzdO6ZTkt7WRjUVePEQ7dys7SUGc/Ys8sPyn9r/gKqfi9g84j8uc6HaLKbB/jmrdVSdGMBVNvDEZtgeSpJMSRqZ/jPjB9jW0RHXCia8161lzpG6mnACyoL/bt6l1zpXA98sa4NFbaBRATXP+Rwd+gNONSn40kLYWegp/hvnsCgRsE70FfSrH+9NNsCpNvMli1TexqTuoQB1xz7MUnsMEwc/kkHM8NDcpEH+AGbNbVlSy3pLVe2EPS0ps2ElPp9WKpMrkywhN2LZT510TgRK6UoS23QBp2ZxqNPZLgK/qZh91M++pXYX/kBX5ACpOdBSccyMyHMN+aO//690zfC7Glk6t+i68R9odMFesPrDGPeWvhfZvtEuxW6TIOYLVqNOG7xR6/ilcGir7wrHNLvAmw4M", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0d6533239e4db8272?role=publish_subscribe", "ResponseMetadata": {"RequestId": "48b9d452-99da-4b4d-9e30-148c4648760e", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:44:12 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "48b9d452-99da-4b4d-9e30-148c4648760e"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo AhNjLyNqKvKkPpDrBmFRWXQhYa sudo yum install -y awscli echo $'\n'$? echo JuLdCBzespYaUSOaucFXezVwIt ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ AhNjLyNqKvKkPpDrBmFRWXQhYa <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 1, cmd (yum install -y awscli...), pausing for 1 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0d6533239e4db8272 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-09a773809c4290ba8", "TokenValue": "AAEAAY8euMXFMJqb6NktLar2duBd+N19wyEaDkoCkanNHU2RAAAAAGCJEoofW/XfRQ9bW2MlXFDd2V+3X2Dg9t1qHGvHkz8Ms1kHMZVNHAq4vk6YnulLLJmDf8GuBAbm1UpguJLbtdI1/dmWMXCSAHmAKwdCchds+eP4a0kBNWNCWRpa4g5igD6t+gwJNqtYFgfofbUJ1tPYenBUHtP/iYaWloP9NKXMDlcxB80mIc0jhWdK7IM+ohztD4HHWz9YLjw/yTrnUjTVMoLgoVAYp+42knhG5DYxXW6l5R6j2KUdGCgCsPmiQog9rZnpG1FR9Tr3+EpuEQhxZ4jRQA7Oez12KE1TMCcp5y22pg1i2tZ5bSu+NreIBmorVTay0RSoGtVCIGvcFs0T3UIQZQtlGwNhwpbOFqyT50d6N99zw7chzv5ORi3ilmweSIEqbUFTaCfCGxy7bOX+br5z", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-09a773809c4290ba8?role=publish_subscribe", "ResponseMetadata": {"RequestId": "6f105bd2-61c4-49b3-92b5-64b71149161d", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:45:14 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "6f105bd2-61c4-49b3-92b5-64b71149161d"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo fxUMwVtRygloIfujoykKZqsRYQ sudo yum install -y awscli echo $'\n'$? echo meoFrFEeqnsFelOUcbgYMqWcqf ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ fxUMwVtRygloIfujoykKZqsRYQ <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 2, cmd (yum install -y awscli...), pausing for 3 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-09a773809c4290ba8 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-04ce28f1ed0a9b2cc", "TokenValue": "AAEAAWShVQvs4lr+jZzebJuPI/kjqeHN9aRbG8Ga+dDyG92JAAAAAGCJEsu8ji1RBCTYUF6gZuRvoNRCynBSdcj5DEXOx/aGcIvd9dhQ35CL3yqd6vc2SG3CfGuVDrzaPjXdqbSpK8vYeC8T6o1iqCQQZTWRjx3hv1JPNcIvqKToXnVNYEehyuqL9AiEwjsp4BKsj+1GyZaONSEhu3hGv7CaU0lLwsZSeLNx/gUo48QKJJdfUFhAfElnlyt/bLgAFNokPWfhJo9C8eJaGUbPjGx5q5fFajpbCt56XE6bMqdvDkQq0rL0CCVOa8OwcXrq1cixwj8zyVJRk4r1xFaxVJUrNSiZjBef8XnuIJSwJGS4rqW3xj7MAcN+fP37cwsvRDXzaJiaNIQixd4BMUJT9DKBTnt5k8CKlkig/1CkLiqRfpTt/1dDrk3ijIn+WmijmUIGzXGTASXf4NL4", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-04ce28f1ed0a9b2cc?role=publish_subscribe", "ResponseMetadata": {"RequestId": "079764cf-ef62-4378-a6a7-c1aa982b2175", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:46:19 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "079764cf-ef62-4378-a6a7-c1aa982b2175"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo mYEabajpUREmWopOVdtXWVjhjA sudo yum install -y awscli echo $'\n'$? echo HUOIrDSkTqNbXtGnpsfqUWmKse ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ mYEabajpUREmWopOVdtXWVjhjA <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-04ce28f1ed0a9b2cc fatal: [i-01a919b33286168b1]: UNREACHABLE! => { "changed": false, "msg": "SSM exec_command timeout on host: i-01a919b33286168b1", "unreachable": true } PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 When I apply the patch, it works well [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-03fc91cde78438694", "TokenValue": "AAEAAW/9pxZQ5rD36JpYalo7sawVweoKITNNtI4392BVkuEDAAAAAGCJE4m7i9Fiy79NAlD8WLAXo1Ybury4avfnW75u3V57mFHcOLF/NHkGHVrg9CgaddaKEdq46EmXmpnqL4BJ/bUzE6sm8YpX/JyLmxnuBaOMMfTEpBdTmTdEjJfq3JeRG3ze4klZwUAO3Bkr6Y4PebzPDSsiC9cYa/vF7JKWS05BR80j0eX3JrI02NQs6Xl4R12D88l80kxvhorMtSwdSuwVrfDJtVSX0AgRpDgc3ZaeoZOl6INJSz1joXdykO6J6sFNUorQwLYVOet8EgHRHSxes2rhWccZxsNWA4WDqLe4yJ53/aVfvEtAXrC5sB/dEdyh0HaT7e3xZJGgTLqkY8tPZ1t96ftCU4WCGyqcmsey6AHjY4pyKzspibjtb+3mQiFmhHVY2qXJdNm/GK8QiM3KvDNV", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-03fc91cde78438694?role=publish_subscribe", "ResponseMetadata": {"RequestId": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:49:29 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n' <i-01a919b33286168b1> PRE startup output received <i-01a919b33286168b1> PRE Disabling Echo: b'stty -echo\n' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ ' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ s' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ ' <i-01a919b33286168b1> PRE Disabling Prompt: b"PS1='' ; printf '\\n%s\\n' 'tzLzeOyQfgbHdOairfXctIHvCE'\n" <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ \r\r\ntzLzeOyQfgbHdOairfXctIHvCE\r\r\n' <i-01a919b33286168b1> PRE Terminal configured <i-01a919b33286168b1> SSM CONNECTION ID: A512753-03fc91cde78438694 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'printf '%s\n' 'unVADXWGDhKpmPYyJlyAahHsWK'; echo | sudo yum install -y awscli; printf '\n%s\n%s\n' "$?" 'swsasimtXIvBgCtvgOQifPBsrV'; ' <i-01a919b33286168b1> EXEC stdout line: unVADXWGDhKpmPYyJlyAahHsWK <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: 0 <i-01a919b33286168b1> EXEC stdout line: swsasimtXIvBgCtvgOQifPBsrV <i-01a919b33286168b1> POST_PROCESS: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do 0 <i-01a919b33286168b1> (0, 'Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r', '') <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-03fc91cde78438694 changed: [i-01a919b33286168b1] => { "changed": true, "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r", "stdout_lines": [ "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd", "", "", "", "amzn2-core | 3.7 kB 00:00 ", "", "", "332 packages excluded due to repository priority protections", "", "", "Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version", "", "", "Nothing to do", "", "" ] } META: ran handlers META: ran handlers PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 With the patch, it also works with gather_facts: true Reviewed-by: Mark Chappell <None> (cherry picked from commit a5b44b8)
[PR #558/a5b44b8a backport][stable-5] fix ssm connection plugin fails at gathering facts This is a backport of PR #558 as merged into main (a5b44b8). SUMMARY Apply diff proposed by @thomas-anderson-bsl #113 (comment) Fix #113 Fix #1163 ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION Currently the example is failing on my Linux laptop [vagrant@centos8 test]$ env |grep AWS AWS_PROFILE=TKM_NOPROD AWS_DEFAULT_REGION=eu-west-3 AWS_SDK_LOAD_CONFIG=1 [vagrant@centos8 test]$ aws sts get-caller-identity { "UserId": "AROAQIIBQ3JCUSOU4JWCK:A512753", "Account": "017719941701", "Arn": "arn:aws:sts::017719941701:assumed-role/SysAdmin/A512753" } [vagrant@centos8 test]$ cat linux.yaml - name: install aws-cli hosts: all gather_facts: false vars: ansible_connection: aws_ssm ansible_aws_ssm_bucket_name: tkm-exported-logs ansible_aws_ssm_region: eu-west-3 tasks: - name: aws-cli raw: yum install -y awscli tags: aws-cli [vagrant@centos8 test]$ cat aws_ec2.yml plugin: aws_ec2 regions: - eu-west-3 hostnames: - instance-id filters: tag:SSMTag: ssmlinux [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 redirecting (type: connection) ansible.builtin.aws_ssm to community.aws.aws_ssm Loading collection community.aws from /home/vagrant/.local/lib/python3.6/site-packages/ansible_collections/community/aws <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0c292c1774b397c6f", "TokenValue": "AAEAAf79ujbqpQGYfHpLaJiTOlhUExBJDOkiLd/Fbq/alKF7AAAAAGCJEg4Fl3ljDMM9XwWJvAyTVsF3XwDlkJzbk4+c2802jl7gIIIODbDpCdsh9YRRLe5zIb1eXcZCTAquivDmzKpNp46ZxxRg/8UK/y5zeq8SvB58Fv8ir91F9LfxQD/hjVYOXKbU6MTjBeL7/JLCrWio5jV55NjXV1PMFWVVbfYvR+lesRhPKVhFf6bO4quyCTL+bmEDVAmCJnQX52KwBSqJhKArWUjAsmCfVj/YqaPLt1xmcR+CMlwO/x1VZPm6n2BBpFRr856bxsmVdEBOl/ckwsOK9k3JrTGQQuGxAVplO5rKlynBD15h2J4/CX1f2RiPOQghLyLSOUaSMA/o0MJMFkD7vMztgswj91lTqJKEu5O5fV1/3s1FnqRrXfFV6/+tcECoaDPxqbPvBiouN+5HHw4S", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0c292c1774b397c6f?role=publish_subscribe", "ResponseMetadata": {"RequestId": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:43:10 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo MjGohIiJUEeYoYWfZIfzrUfbLg sudo yum install -y awscli echo $'\n'$? echo YoJSNqxmpcVfcJGJRJVfIteacP ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ MjGohIiJUEeYoYWfZIfzrUfbLg <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 57 <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 0, cmd (yum install -y awscli...), pausing for 0 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0c292c1774b397c6f <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0d6533239e4db8272", "TokenValue": "AAEAAcua+Crf0t+FmSNgvZSpxTvDQksaWVQiDjJ96ZmNStp0AAAAAGCJEkzdO6ZTkt7WRjUVePEQ7dys7SUGc/Ys8sPyn9r/gKqfi9g84j8uc6HaLKbB/jmrdVSdGMBVNvDEZtgeSpJMSRqZ/jPjB9jW0RHXCia8161lzpG6mnACyoL/bt6l1zpXA98sa4NFbaBRATXP+Rwd+gNONSn40kLYWegp/hvnsCgRsE70FfSrH+9NNsCpNvMli1TexqTuoQB1xz7MUnsMEwc/kkHM8NDcpEH+AGbNbVlSy3pLVe2EPS0ps2ElPp9WKpMrkywhN2LZT510TgRK6UoS23QBp2ZxqNPZLgK/qZh91M++pXYX/kBX5ACpOdBSccyMyHMN+aO//690zfC7Glk6t+i68R9odMFesPrDGPeWvhfZvtEuxW6TIOYLVqNOG7xR6/ilcGir7wrHNLvAmw4M", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0d6533239e4db8272?role=publish_subscribe", "ResponseMetadata": {"RequestId": "48b9d452-99da-4b4d-9e30-148c4648760e", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:44:12 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "48b9d452-99da-4b4d-9e30-148c4648760e"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo AhNjLyNqKvKkPpDrBmFRWXQhYa sudo yum install -y awscli echo $'\n'$? echo JuLdCBzespYaUSOaucFXezVwIt ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ AhNjLyNqKvKkPpDrBmFRWXQhYa <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 1, cmd (yum install -y awscli...), pausing for 1 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0d6533239e4db8272 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-09a773809c4290ba8", "TokenValue": "AAEAAY8euMXFMJqb6NktLar2duBd+N19wyEaDkoCkanNHU2RAAAAAGCJEoofW/XfRQ9bW2MlXFDd2V+3X2Dg9t1qHGvHkz8Ms1kHMZVNHAq4vk6YnulLLJmDf8GuBAbm1UpguJLbtdI1/dmWMXCSAHmAKwdCchds+eP4a0kBNWNCWRpa4g5igD6t+gwJNqtYFgfofbUJ1tPYenBUHtP/iYaWloP9NKXMDlcxB80mIc0jhWdK7IM+ohztD4HHWz9YLjw/yTrnUjTVMoLgoVAYp+42knhG5DYxXW6l5R6j2KUdGCgCsPmiQog9rZnpG1FR9Tr3+EpuEQhxZ4jRQA7Oez12KE1TMCcp5y22pg1i2tZ5bSu+NreIBmorVTay0RSoGtVCIGvcFs0T3UIQZQtlGwNhwpbOFqyT50d6N99zw7chzv5ORi3ilmweSIEqbUFTaCfCGxy7bOX+br5z", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-09a773809c4290ba8?role=publish_subscribe", "ResponseMetadata": {"RequestId": "6f105bd2-61c4-49b3-92b5-64b71149161d", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:45:14 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "6f105bd2-61c4-49b3-92b5-64b71149161d"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo fxUMwVtRygloIfujoykKZqsRYQ sudo yum install -y awscli echo $'\n'$? echo meoFrFEeqnsFelOUcbgYMqWcqf ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ fxUMwVtRygloIfujoykKZqsRYQ <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 2, cmd (yum install -y awscli...), pausing for 3 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-09a773809c4290ba8 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-04ce28f1ed0a9b2cc", "TokenValue": "AAEAAWShVQvs4lr+jZzebJuPI/kjqeHN9aRbG8Ga+dDyG92JAAAAAGCJEsu8ji1RBCTYUF6gZuRvoNRCynBSdcj5DEXOx/aGcIvd9dhQ35CL3yqd6vc2SG3CfGuVDrzaPjXdqbSpK8vYeC8T6o1iqCQQZTWRjx3hv1JPNcIvqKToXnVNYEehyuqL9AiEwjsp4BKsj+1GyZaONSEhu3hGv7CaU0lLwsZSeLNx/gUo48QKJJdfUFhAfElnlyt/bLgAFNokPWfhJo9C8eJaGUbPjGx5q5fFajpbCt56XE6bMqdvDkQq0rL0CCVOa8OwcXrq1cixwj8zyVJRk4r1xFaxVJUrNSiZjBef8XnuIJSwJGS4rqW3xj7MAcN+fP37cwsvRDXzaJiaNIQixd4BMUJT9DKBTnt5k8CKlkig/1CkLiqRfpTt/1dDrk3ijIn+WmijmUIGzXGTASXf4NL4", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-04ce28f1ed0a9b2cc?role=publish_subscribe", "ResponseMetadata": {"RequestId": "079764cf-ef62-4378-a6a7-c1aa982b2175", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:46:19 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "079764cf-ef62-4378-a6a7-c1aa982b2175"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo mYEabajpUREmWopOVdtXWVjhjA sudo yum install -y awscli echo $'\n'$? echo HUOIrDSkTqNbXtGnpsfqUWmKse ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ mYEabajpUREmWopOVdtXWVjhjA <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-04ce28f1ed0a9b2cc fatal: [i-01a919b33286168b1]: UNREACHABLE! => { "changed": false, "msg": "SSM exec_command timeout on host: i-01a919b33286168b1", "unreachable": true } PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 When I apply the patch, it works well [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-03fc91cde78438694", "TokenValue": "AAEAAW/9pxZQ5rD36JpYalo7sawVweoKITNNtI4392BVkuEDAAAAAGCJE4m7i9Fiy79NAlD8WLAXo1Ybury4avfnW75u3V57mFHcOLF/NHkGHVrg9CgaddaKEdq46EmXmpnqL4BJ/bUzE6sm8YpX/JyLmxnuBaOMMfTEpBdTmTdEjJfq3JeRG3ze4klZwUAO3Bkr6Y4PebzPDSsiC9cYa/vF7JKWS05BR80j0eX3JrI02NQs6Xl4R12D88l80kxvhorMtSwdSuwVrfDJtVSX0AgRpDgc3ZaeoZOl6INJSz1joXdykO6J6sFNUorQwLYVOet8EgHRHSxes2rhWccZxsNWA4WDqLe4yJ53/aVfvEtAXrC5sB/dEdyh0HaT7e3xZJGgTLqkY8tPZ1t96ftCU4WCGyqcmsey6AHjY4pyKzspibjtb+3mQiFmhHVY2qXJdNm/GK8QiM3KvDNV", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-03fc91cde78438694?role=publish_subscribe", "ResponseMetadata": {"RequestId": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:49:29 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n' <i-01a919b33286168b1> PRE startup output received <i-01a919b33286168b1> PRE Disabling Echo: b'stty -echo\n' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ ' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ s' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ ' <i-01a919b33286168b1> PRE Disabling Prompt: b"PS1='' ; printf '\\n%s\\n' 'tzLzeOyQfgbHdOairfXctIHvCE'\n" <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ \r\r\ntzLzeOyQfgbHdOairfXctIHvCE\r\r\n' <i-01a919b33286168b1> PRE Terminal configured <i-01a919b33286168b1> SSM CONNECTION ID: A512753-03fc91cde78438694 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'printf '%s\n' 'unVADXWGDhKpmPYyJlyAahHsWK'; echo | sudo yum install -y awscli; printf '\n%s\n%s\n' "$?" 'swsasimtXIvBgCtvgOQifPBsrV'; ' <i-01a919b33286168b1> EXEC stdout line: unVADXWGDhKpmPYyJlyAahHsWK <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: 0 <i-01a919b33286168b1> EXEC stdout line: swsasimtXIvBgCtvgOQifPBsrV <i-01a919b33286168b1> POST_PROCESS: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do 0 <i-01a919b33286168b1> (0, 'Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r', '') <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-03fc91cde78438694 changed: [i-01a919b33286168b1] => { "changed": true, "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r", "stdout_lines": [ "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd", "", "", "", "amzn2-core | 3.7 kB 00:00 ", "", "", "332 packages excluded due to repository priority protections", "", "", "Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version", "", "", "Nothing to do", "", "" ] } META: ran handlers META: ran handlers PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 With the patch, it also works with gather_facts: true Reviewed-by: Mark Chappell <None>
[PR #558/a5b44b8a backport][stable-4] fix ssm connection plugin fails at gathering facts This is a backport of PR #558 as merged into main (a5b44b8). SUMMARY Apply diff proposed by @thomas-anderson-bsl #113 (comment) Fix #113 Fix #1163 ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_ssm ADDITIONAL INFORMATION Currently the example is failing on my Linux laptop [vagrant@centos8 test]$ env |grep AWS AWS_PROFILE=TKM_NOPROD AWS_DEFAULT_REGION=eu-west-3 AWS_SDK_LOAD_CONFIG=1 [vagrant@centos8 test]$ aws sts get-caller-identity { "UserId": "AROAQIIBQ3JCUSOU4JWCK:A512753", "Account": "017719941701", "Arn": "arn:aws:sts::017719941701:assumed-role/SysAdmin/A512753" } [vagrant@centos8 test]$ cat linux.yaml - name: install aws-cli hosts: all gather_facts: false vars: ansible_connection: aws_ssm ansible_aws_ssm_bucket_name: tkm-exported-logs ansible_aws_ssm_region: eu-west-3 tasks: - name: aws-cli raw: yum install -y awscli tags: aws-cli [vagrant@centos8 test]$ cat aws_ec2.yml plugin: aws_ec2 regions: - eu-west-3 hostnames: - instance-id filters: tag:SSMTag: ssmlinux [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 redirecting (type: connection) ansible.builtin.aws_ssm to community.aws.aws_ssm Loading collection community.aws from /home/vagrant/.local/lib/python3.6/site-packages/ansible_collections/community/aws <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0c292c1774b397c6f", "TokenValue": "AAEAAf79ujbqpQGYfHpLaJiTOlhUExBJDOkiLd/Fbq/alKF7AAAAAGCJEg4Fl3ljDMM9XwWJvAyTVsF3XwDlkJzbk4+c2802jl7gIIIODbDpCdsh9YRRLe5zIb1eXcZCTAquivDmzKpNp46ZxxRg/8UK/y5zeq8SvB58Fv8ir91F9LfxQD/hjVYOXKbU6MTjBeL7/JLCrWio5jV55NjXV1PMFWVVbfYvR+lesRhPKVhFf6bO4quyCTL+bmEDVAmCJnQX52KwBSqJhKArWUjAsmCfVj/YqaPLt1xmcR+CMlwO/x1VZPm6n2BBpFRr856bxsmVdEBOl/ckwsOK9k3JrTGQQuGxAVplO5rKlynBD15h2J4/CX1f2RiPOQghLyLSOUaSMA/o0MJMFkD7vMztgswj91lTqJKEu5O5fV1/3s1FnqRrXfFV6/+tcECoaDPxqbPvBiouN+5HHw4S", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0c292c1774b397c6f?role=publish_subscribe", "ResponseMetadata": {"RequestId": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:43:10 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "cd5a7d6a-406c-4a7b-9840-d74ce2a7db09"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo MjGohIiJUEeYoYWfZIfzrUfbLg sudo yum install -y awscli echo $'\n'$? echo YoJSNqxmpcVfcJGJRJVfIteacP ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0c292c1774b397c6f <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ MjGohIiJUEeYoYWfZIfzrUfbLg <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 57 <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 0, cmd (yum install -y awscli...), pausing for 0 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0c292c1774b397c6f <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-0d6533239e4db8272", "TokenValue": "AAEAAcua+Crf0t+FmSNgvZSpxTvDQksaWVQiDjJ96ZmNStp0AAAAAGCJEkzdO6ZTkt7WRjUVePEQ7dys7SUGc/Ys8sPyn9r/gKqfi9g84j8uc6HaLKbB/jmrdVSdGMBVNvDEZtgeSpJMSRqZ/jPjB9jW0RHXCia8161lzpG6mnACyoL/bt6l1zpXA98sa4NFbaBRATXP+Rwd+gNONSn40kLYWegp/hvnsCgRsE70FfSrH+9NNsCpNvMli1TexqTuoQB1xz7MUnsMEwc/kkHM8NDcpEH+AGbNbVlSy3pLVe2EPS0ps2ElPp9WKpMrkywhN2LZT510TgRK6UoS23QBp2ZxqNPZLgK/qZh91M++pXYX/kBX5ACpOdBSccyMyHMN+aO//690zfC7Glk6t+i68R9odMFesPrDGPeWvhfZvtEuxW6TIOYLVqNOG7xR6/ilcGir7wrHNLvAmw4M", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-0d6533239e4db8272?role=publish_subscribe", "ResponseMetadata": {"RequestId": "48b9d452-99da-4b4d-9e30-148c4648760e", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:44:12 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "48b9d452-99da-4b4d-9e30-148c4648760e"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo AhNjLyNqKvKkPpDrBmFRWXQhYa sudo yum install -y awscli echo $'\n'$? echo JuLdCBzespYaUSOaucFXezVwIt ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-0d6533239e4db8272 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ AhNjLyNqKvKkPpDrBmFRWXQhYa <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 1, cmd (yum install -y awscli...), pausing for 1 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-0d6533239e4db8272 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-09a773809c4290ba8", "TokenValue": "AAEAAY8euMXFMJqb6NktLar2duBd+N19wyEaDkoCkanNHU2RAAAAAGCJEoofW/XfRQ9bW2MlXFDd2V+3X2Dg9t1qHGvHkz8Ms1kHMZVNHAq4vk6YnulLLJmDf8GuBAbm1UpguJLbtdI1/dmWMXCSAHmAKwdCchds+eP4a0kBNWNCWRpa4g5igD6t+gwJNqtYFgfofbUJ1tPYenBUHtP/iYaWloP9NKXMDlcxB80mIc0jhWdK7IM+ohztD4HHWz9YLjw/yTrnUjTVMoLgoVAYp+42knhG5DYxXW6l5R6j2KUdGCgCsPmiQog9rZnpG1FR9Tr3+EpuEQhxZ4jRQA7Oez12KE1TMCcp5y22pg1i2tZ5bSu+NreIBmorVTay0RSoGtVCIGvcFs0T3UIQZQtlGwNhwpbOFqyT50d6N99zw7chzv5ORi3ilmweSIEqbUFTaCfCGxy7bOX+br5z", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-09a773809c4290ba8?role=publish_subscribe", "ResponseMetadata": {"RequestId": "6f105bd2-61c4-49b3-92b5-64b71149161d", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:45:14 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "6f105bd2-61c4-49b3-92b5-64b71149161d"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo fxUMwVtRygloIfujoykKZqsRYQ sudo yum install -y awscli echo $'\n'$? echo meoFrFEeqnsFelOUcbgYMqWcqf ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-09a773809c4290ba8 <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ fxUMwVtRygloIfujoykKZqsRYQ <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 58 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> ssm_retry: attempt: 2, cmd (yum install -y awscli...), pausing for 3 seconds <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-09a773809c4290ba8 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-04ce28f1ed0a9b2cc", "TokenValue": "AAEAAWShVQvs4lr+jZzebJuPI/kjqeHN9aRbG8Ga+dDyG92JAAAAAGCJEsu8ji1RBCTYUF6gZuRvoNRCynBSdcj5DEXOx/aGcIvd9dhQ35CL3yqd6vc2SG3CfGuVDrzaPjXdqbSpK8vYeC8T6o1iqCQQZTWRjx3hv1JPNcIvqKToXnVNYEehyuqL9AiEwjsp4BKsj+1GyZaONSEhu3hGv7CaU0lLwsZSeLNx/gUo48QKJJdfUFhAfElnlyt/bLgAFNokPWfhJo9C8eJaGUbPjGx5q5fFajpbCt56XE6bMqdvDkQq0rL0CCVOa8OwcXrq1cixwj8zyVJRk4r1xFaxVJUrNSiZjBef8XnuIJSwJGS4rqW3xj7MAcN+fP37cwsvRDXzaJiaNIQixd4BMUJT9DKBTnt5k8CKlkig/1CkLiqRfpTt/1dDrk3ijIn+WmijmUIGzXGTASXf4NL4", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-04ce28f1ed0a9b2cc?role=publish_subscribe", "ResponseMetadata": {"RequestId": "079764cf-ef62-4378-a6a7-c1aa982b2175", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:46:19 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "079764cf-ef62-4378-a6a7-c1aa982b2175"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> SSM CONNECTION ID: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'echo mYEabajpUREmWopOVdtXWVjhjA sudo yum install -y awscli echo $'\n'$? echo HUOIrDSkTqNbXtGnpsfqUWmKse ' <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: Starting session with SessionId: A512753-04ce28f1ed0a9b2cc <i-01a919b33286168b1> EXEC remaining: 60 <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ stty -echo <i-01a919b33286168b1> EXEC stdout line: sh-4.2$ mYEabajpUREmWopOVdtXWVjhjA <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC remaining: 56 <i-01a919b33286168b1> EXEC remaining: 55 <i-01a919b33286168b1> EXEC remaining: 54 <i-01a919b33286168b1> EXEC remaining: 53 <i-01a919b33286168b1> EXEC remaining: 52 <i-01a919b33286168b1> EXEC remaining: 51 <i-01a919b33286168b1> EXEC remaining: 50 <i-01a919b33286168b1> EXEC remaining: 49 <i-01a919b33286168b1> EXEC remaining: 48 <i-01a919b33286168b1> EXEC remaining: 47 <i-01a919b33286168b1> EXEC remaining: 46 <i-01a919b33286168b1> EXEC remaining: 45 <i-01a919b33286168b1> EXEC remaining: 44 <i-01a919b33286168b1> EXEC remaining: 43 <i-01a919b33286168b1> EXEC remaining: 42 <i-01a919b33286168b1> EXEC remaining: 41 <i-01a919b33286168b1> EXEC remaining: 40 <i-01a919b33286168b1> EXEC remaining: 39 <i-01a919b33286168b1> EXEC remaining: 38 <i-01a919b33286168b1> EXEC remaining: 37 <i-01a919b33286168b1> EXEC remaining: 36 <i-01a919b33286168b1> EXEC remaining: 35 <i-01a919b33286168b1> EXEC remaining: 34 <i-01a919b33286168b1> EXEC remaining: 33 <i-01a919b33286168b1> EXEC remaining: 32 <i-01a919b33286168b1> EXEC remaining: 31 <i-01a919b33286168b1> EXEC remaining: 30 <i-01a919b33286168b1> EXEC remaining: 29 <i-01a919b33286168b1> EXEC remaining: 28 <i-01a919b33286168b1> EXEC remaining: 27 <i-01a919b33286168b1> EXEC remaining: 26 <i-01a919b33286168b1> EXEC remaining: 25 <i-01a919b33286168b1> EXEC remaining: 24 <i-01a919b33286168b1> EXEC remaining: 23 <i-01a919b33286168b1> EXEC remaining: 22 <i-01a919b33286168b1> EXEC remaining: 21 <i-01a919b33286168b1> EXEC remaining: 20 <i-01a919b33286168b1> EXEC remaining: 19 <i-01a919b33286168b1> EXEC remaining: 18 <i-01a919b33286168b1> EXEC remaining: 17 <i-01a919b33286168b1> EXEC remaining: 16 <i-01a919b33286168b1> EXEC remaining: 15 <i-01a919b33286168b1> EXEC remaining: 14 <i-01a919b33286168b1> EXEC remaining: 13 <i-01a919b33286168b1> EXEC remaining: 12 <i-01a919b33286168b1> EXEC remaining: 11 <i-01a919b33286168b1> EXEC remaining: 10 <i-01a919b33286168b1> EXEC remaining: 9 <i-01a919b33286168b1> EXEC remaining: 8 <i-01a919b33286168b1> EXEC remaining: 7 <i-01a919b33286168b1> EXEC remaining: 6 <i-01a919b33286168b1> EXEC remaining: 5 <i-01a919b33286168b1> EXEC remaining: 4 <i-01a919b33286168b1> EXEC remaining: 3 <i-01a919b33286168b1> EXEC remaining: 2 <i-01a919b33286168b1> EXEC remaining: 1 <i-01a919b33286168b1> EXEC timeout stdout: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-04ce28f1ed0a9b2cc fatal: [i-01a919b33286168b1]: UNREACHABLE! => { "changed": false, "msg": "SSM exec_command timeout on host: i-01a919b33286168b1", "unreachable": true } PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=0 changed=0 unreachable=1 failed=0 skipped=0 rescued=0 ignored=0 When I apply the patch, it works well [vagrant@centos8 test]$ ansible-playbook linux.yaml -i aws_ec2.yml -vvvv ansible-playbook 2.10.5 config file = /home/vagrant/.ansible.cfg configured module search path = ['/home/vagrant/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /home/vagrant/.local/lib/python3.6/site-packages/ansible executable location = /home/vagrant/.local/bin/ansible-playbook python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)] Using /home/vagrant/.ansible.cfg as config file setting up inventory plugins host_list declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method script declined parsing /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml as it did not pass its verify_file() method redirecting (type: inventory) ansible.builtin.aws_ec2 to amazon.aws.aws_ec2 Loading collection amazon.aws from /home/vagrant/.ansible/collections/ansible_collections/amazon/aws Parsed /tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml inventory source with auto plugin Loading callback plugin default of type stdout, v2.0 from /home/vagrant/.local/lib/python3.6/site-packages/ansible/plugins/callback/default.py Skipping callback 'default', as we already have a stdout callback. Skipping callback 'minimal', as we already have a stdout callback. Skipping callback 'oneline', as we already have a stdout callback. PLAYBOOK: linux.yaml *************************************************************************************************************************************************** Positional arguments: linux.yaml verbosity: 4 connection: smart timeout: 10 become_method: sudo tags: ('all',) inventory: ('/tmp/ansible-ami/base_aws_configuration/test/aws_ec2.yml',) forks: 5 1 plays in linux.yaml PLAY [install aws-cli] ************************************************************************************************************************************************* META: ran handlers TASK [aws-cli] ********************************************************************************************************************************************************* task path: /tmp/ansible-ami/base_aws_configuration/test/linux.yaml:9 <i-01a919b33286168b1> ESTABLISH SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> SSM COMMAND: ['/usr/local/bin/session-manager-plugin', '{"SessionId": "A512753-03fc91cde78438694", "TokenValue": "AAEAAW/9pxZQ5rD36JpYalo7sawVweoKITNNtI4392BVkuEDAAAAAGCJE4m7i9Fiy79NAlD8WLAXo1Ybury4avfnW75u3V57mFHcOLF/NHkGHVrg9CgaddaKEdq46EmXmpnqL4BJ/bUzE6sm8YpX/JyLmxnuBaOMMfTEpBdTmTdEjJfq3JeRG3ze4klZwUAO3Bkr6Y4PebzPDSsiC9cYa/vF7JKWS05BR80j0eX3JrI02NQs6Xl4R12D88l80kxvhorMtSwdSuwVrfDJtVSX0AgRpDgc3ZaeoZOl6INJSz1joXdykO6J6sFNUorQwLYVOet8EgHRHSxes2rhWccZxsNWA4WDqLe4yJ53/aVfvEtAXrC5sB/dEdyh0HaT7e3xZJGgTLqkY8tPZ1t96ftCU4WCGyqcmsey6AHjY4pyKzspibjtb+3mQiFmhHVY2qXJdNm/GK8QiM3KvDNV", "StreamUrl": "wss://ssmmessages.eu-west-3.amazonaws.com/v1/data-channel/A512753-03fc91cde78438694?role=publish_subscribe", "ResponseMetadata": {"RequestId": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7", "HTTPStatusCode": 200, "HTTPHeaders": {"server": "Server", "date": "Wed, 28 Apr 2021 07:49:29 GMT", "content-type": "application/x-amz-json-1.1", "content-length": "642", "connection": "keep-alive", "x-amzn-requestid": "ae9980f6-68e2-4724-9e9d-cd46030ff8a7"}, "RetryAttempts": 0}}', 'eu-west-3', 'StartSession', '', '{"Target": "i-01a919b33286168b1"}', 'https://ssm.eu-west-3.amazonaws.com'] <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n' <i-01a919b33286168b1> PRE startup output received <i-01a919b33286168b1> PRE Disabling Echo: b'stty -echo\n' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ ' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ s' <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ ' <i-01a919b33286168b1> PRE Disabling Prompt: b"PS1='' ; printf '\\n%s\\n' 'tzLzeOyQfgbHdOairfXctIHvCE'\n" <i-01a919b33286168b1> PRE stdout line: b'\r\nStarting session with SessionId: A512753-03fc91cde78438694\r\n\x1b[?1034hsh-4.2$ stty -echo\r\r\nsh-4.2$ \r\r\ntzLzeOyQfgbHdOairfXctIHvCE\r\r\n' <i-01a919b33286168b1> PRE Terminal configured <i-01a919b33286168b1> SSM CONNECTION ID: A512753-03fc91cde78438694 <i-01a919b33286168b1> EXEC yum install -y awscli <i-01a919b33286168b1> _wrap_command: 'printf '%s\n' 'unVADXWGDhKpmPYyJlyAahHsWK'; echo | sudo yum install -y awscli; printf '\n%s\n%s\n' "$?" 'swsasimtXIvBgCtvgOQifPBsrV'; ' <i-01a919b33286168b1> EXEC stdout line: unVADXWGDhKpmPYyJlyAahHsWK <i-01a919b33286168b1> EXEC stdout line: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 <i-01a919b33286168b1> EXEC remaining: 59 <i-01a919b33286168b1> EXEC stdout line: 332 packages excluded due to repository priority protections <i-01a919b33286168b1> EXEC stdout line: Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version <i-01a919b33286168b1> EXEC stdout line: Nothing to do <i-01a919b33286168b1> EXEC stdout line: <i-01a919b33286168b1> EXEC stdout line: 0 <i-01a919b33286168b1> EXEC stdout line: swsasimtXIvBgCtvgOQifPBsrV <i-01a919b33286168b1> POST_PROCESS: Loaded plugins: extras_suggestions, langpacks, priorities, update-motd amzn2-core | 3.7 kB 00:00 332 packages excluded due to repository priority protections Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version Nothing to do 0 <i-01a919b33286168b1> (0, 'Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r', '') <i-01a919b33286168b1> CLOSING SSM CONNECTION TO: i-01a919b33286168b1 <i-01a919b33286168b1> TERMINATE SSM SESSION: A512753-03fc91cde78438694 changed: [i-01a919b33286168b1] => { "changed": true, "rc": 0, "stderr": "", "stderr_lines": [], "stdout": "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd\r\r\r\n\ramzn2-core | 3.7 kB 00:00 \r\r\r\n332 packages excluded due to repository priority protections\r\r\r\nPackage awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version\r\r\r\nNothing to do\r\r\r", "stdout_lines": [ "Loaded plugins: extras_suggestions, langpacks, priorities, update-motd", "", "", "", "amzn2-core | 3.7 kB 00:00 ", "", "", "332 packages excluded due to repository priority protections", "", "", "Package awscli-1.18.147-1.amzn2.0.1.noarch already installed and latest version", "", "", "Nothing to do", "", "" ] } META: ran handlers META: ran handlers PLAY RECAP ************************************************************************************************************************************************************* i-01a919b33286168b1 : ok=1 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 With the patch, it also works with gather_facts: true Reviewed-by: Mark Chappell <None>
Recent AWS Linux AMIs add some unicode characters to inputs/outputs that can cause this same error message, if you recently launched a new instance / updated AMIs try the following fix - #1756 (comment) |
SUMMARY
Using the ssm plugin, playbooks fail at the gathering facts stage, with:
If using
gather_facts: false
, the same error occurs at the first taskAs far as I can tell, SSM is configured correctly: I can run
aws ssm start-session --target i-xxxxx
from my ansible host and successfully get a shell on the target host.ISSUE TYPE
COMPONENT NAME
ssm connection plugin
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
Both the instance running Ansible and the target (SSM-managed) instance are regular ubuntu 20.04 AMIs
STEPS TO REPRODUCE
aws ssm start-session --target i-xxxxx
Run:
EXPECTED RESULTS
Playbook runs successfully with no errors
ACTUAL RESULTS
Playbook errors on gathering facts stage, with:
with
-vvvv
verbosity:The text was updated successfully, but these errors were encountered: