Open alicekaerast opened 1 year ago
Files identified in the description:
lib/ansible/plugins/connection
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/lib/ansible/plugins/connection)plugins/connection/aws_ssm.py
](https://github.com/['ansible-collections/amazon.aws', 'ansible-collections/community.aws', 'ansible-collections/community.vmware']/blob/main/plugins/connection/aws_ssm.py)If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
I just submitted a similar issue. This can be achieved by setting up port forwarding and streaming file content over it. https://gist.github.com/lukeplausin/4b412d83fb1246b0bed6507b5083b3a7
Summary
As noted in #1853 we believe that using S3 to transfer all of the small files required to run tasks is part of what is making the aws_ssm connection plugin so slow
We should provide an option to transfer files using the SSM session, similar to the
piped
method in thessh
connectionIssue Type
Feature Idea
Component Name
aws_ssm
Additional Information
I believe that one of the performance issues with the aws_ssm connection plugin is that all files are transferred using S3, and that there are multiple file transfers required for each task. Ansible needs to transfer the ansiball_z task files in addition to the files we actually need to transfer, and it doesn't re-use these
The ssh connection has a
piped
option that usesdd
to transfer files. Whilst this is not compatible with Windows hosts, it does suggest that this way of transferring files could work herehttps://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/ssh.py#L1285
I believe that implementing Linux and Windows equivalents of that
piped
mode would improve performance with the aws_ssm connection plugin, though maybe only for smaller files. In fact, the Windows equivalent is probably more important than the Linux version because for Linux hosts many people can instead use SSH over SSM and we have found that Windows hosts take a bigger performance hit than Linux hosts when running this pluginCode of Conduct