Skip to content

Commit

Permalink
aws_ssm connection plugin: fix command execution (fixes ansible-colle…
Browse files Browse the repository at this point in the history
…ctions#113)

Avoid the use of sh and instead use bash directly.
  • Loading branch information
abeluck committed Sep 3, 2020
1 parent b29c6a6 commit 07c571d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/connection/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,16 @@ def start_session(self):

profile_name = ''
region_name = self.get_option('region')
ssm_parameters = dict()
client = self._get_boto_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 = [
Expand Down

0 comments on commit 07c571d

Please sign in to comment.