Skip to content
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

connection/aws_ssm - support environment variable for aws_ssm_plugin variable #2247

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

abikouo
Copy link
Contributor

@abikouo abikouo commented Feb 17, 2025

SUMMARY

Closes #1990

  • Add the possibility to define the aws_ssm_plugin variable using environment variable AWS_SESSION_MANAGER_PLUGIN
  • To avoid breaking change, the default value of the aws_ssm_plugin will remains /usr/local/bin/session-manager-plugin, in case the path is not found, the plugin will try to find the executable from the PATH
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

connection/aws_ssm

Copy link

github-actions bot commented Feb 17, 2025

Docs Build 📝

Thank you for contribution!✨

The docsite for this PR is available for download as an artifact from this run:
https://github.com/ansible-collections/community.aws/actions/runs/13374597614

You can compare to the docs for the main branch here:
https://ansible-collections.github.io/community.aws/branch/main

File changes:

  • M collections/community/aws/aws_ssm_connection.html
  • M collections/environment_variables.html
Click to see the diff comparison.

NOTE: only file modifications are shown here. New and deleted files are excluded.
See the file list and check the published docs to see those files.

diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/aws_ssm_connection.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/aws_ssm_connection.html
index 0250127..b62a732 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/community/aws/aws_ssm_connection.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/community/aws/aws_ssm_connection.html
@@ -260,9 +260,11 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 <a class="ansibleOptionLink" href="#parameter-plugin" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
 <td><div class="ansible-option-cell"><p>This defines the location of the session-manager-plugin binary.</p>
-<p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;/usr/local/bin/session-manager-plugin&quot;</span></code></p>
+<p>Support for environment variable was added in version 9.1.0.</p>
+<p>The plugin will first check the <code class="ansible-value docutils literal notranslate"><span class="pre">'/usr/local/bin/session-manager-plugin'</span></code> as the default path of the SSM plugin if this does not exist, it will find the session-manager-plugin from the PATH environment variable. Added in version 9.1.0.</p>
 <p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
 <ul class="simple">
+<li><p>Environment variable: <span class="target" id="index-1"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_SESSION_MANAGER_PLUGIN"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_SESSION_MANAGER_PLUGIN</span></code></a></p></li>
 <li><p>Variable: ansible_aws_ssm_plugin</p></li>
 </ul>
 </div></td>
@@ -275,7 +277,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 <td><div class="ansible-option-cell"><p>Sets AWS profile to use.</p>
 <p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
 <ul class="simple">
-<li><p>Environment variable: <span class="target" id="index-1"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_PROFILE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_PROFILE</span></code></a></p></li>
+<li><p>Environment variable: <span class="target" id="index-2"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_PROFILE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_PROFILE</span></code></a></p></li>
 <li><p>Variable: ansible_aws_ssm_profile</p></li>
 </ul>
 </div></td>
@@ -300,8 +302,8 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 <p class="ansible-option-line"><strong class="ansible-option-default-bold">Default:</strong> <code class="ansible-option-default docutils literal notranslate"><span class="pre">&quot;us-east-1&quot;</span></code></p>
 <p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
 <ul class="simple">
-<li><p>Environment variable: <span class="target" id="index-2"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_REGION"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_REGION</span></code></a></p></li>
-<li><p>Environment variable: <span class="target" id="index-3"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_DEFAULT_REGION"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_DEFAULT_REGION</span></code></a></p></li>
+<li><p>Environment variable: <span class="target" id="index-3"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_REGION"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_REGION</span></code></a></p></li>
+<li><p>Environment variable: <span class="target" id="index-4"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_DEFAULT_REGION"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_DEFAULT_REGION</span></code></a></p></li>
 <li><p>Variable: ansible_aws_ssm_region</p></li>
 </ul>
 </div></td>
@@ -333,7 +335,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 <td><div class="ansible-option-cell"><p>The STS secret key to use when connecting via session-manager.</p>
 <p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
 <ul class="simple">
-<li><p>Environment variable: <span class="target" id="index-4"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_SECRET_ACCESS_KEY"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_SECRET_ACCESS_KEY</span></code></a></p></li>
+<li><p>Environment variable: <span class="target" id="index-5"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_SECRET_ACCESS_KEY"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_SECRET_ACCESS_KEY</span></code></a></p></li>
 <li><p>Variable: ansible_aws_ssm_secret_access_key</p></li>
 </ul>
 </div></td>
@@ -346,7 +348,7 @@ see <a class="reference internal" href="#ansible-collections-community-aws-aws-s
 <td><div class="ansible-option-cell"><p>The STS session token to use when connecting via session-manager.</p>
 <p class="ansible-option-line"><strong class="ansible-option-configuration">Configuration:</strong></p>
 <ul class="simple">
-<li><p>Environment variable: <span class="target" id="index-5"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_SESSION_TOKEN"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_SESSION_TOKEN</span></code></a></p></li>
+<li><p>Environment variable: <span class="target" id="index-6"></span><a class="reference internal" href="../../environment_variables.html#envvar-AWS_SESSION_TOKEN"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">AWS_SESSION_TOKEN</span></code></a></p></li>
 <li><p>Variable: ansible_aws_ssm_session_token</p></li>
 </ul>
 </div></td>
diff --git a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/environment_variables.html b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/environment_variables.html
index b304fb7..14453f3 100644
--- a/home/runner/work/community.aws/community.aws/docsbuild/base/collections/environment_variables.html
+++ b/home/runner/work/community.aws/community.aws/docsbuild/head/collections/environment_variables.html
@@ -157,6 +157,16 @@ Environment variables used by the ansible-core configuration are documented in <
 <a class="reference internal" href="community/aws/aws_ssm_connection.html#ansible-collections-community-aws-aws-ssm-connection"><span class="std std-ref">community.aws.aws_ssm connection plugin</span></a></p>
 </dd></dl>
 
+<dl class="std envvar">
+<dt class="sig sig-object std" id="envvar-AWS_SESSION_MANAGER_PLUGIN">
+<span class="sig-name descname"><span class="pre">AWS_SESSION_MANAGER_PLUGIN</span></span><a class="headerlink" href="#envvar-AWS_SESSION_MANAGER_PLUGIN" title="Link to this definition"></a></dt>
+<dd><p>This defines the location of the session-manager-plugin binary.</p>
+<p>Support for environment variable was added in version 9.1.0.</p>
+<p>The plugin will first check the <code class="ansible-value docutils literal notranslate"><span class="pre">'/usr/local/bin/session-manager-plugin'</span></code> as the default path of the SSM plugin if this does not exist, it will find the session-manager-plugin from the PATH environment variable. Added in version 9.1.0.</p>
+<p><em>Used by:</em>
+<a class="reference internal" href="community/aws/aws_ssm_connection.html#ansible-collections-community-aws-aws-ssm-connection"><span class="std std-ref">community.aws.aws_ssm connection plugin</span></a></p>
+</dd></dl>
+
 <dl class="std envvar">
 <dt class="sig sig-object std" id="envvar-AWS_SESSION_TOKEN">
 <span class="sig-name descname"><span class="pre">AWS_SESSION_TOKEN</span></span><a class="headerlink" href="#envvar-AWS_SESSION_TOKEN" title="Link to this definition"></a></dt>

@abikouo abikouo force-pushed the aws_ssm_bug_fixes_20250217 branch from 65135ec to 5f9519c Compare February 17, 2025 16:20
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5405f85b436448478c31682fbe71309e

✔️ ansible-galaxy-importer SUCCESS in 3m 43s (non-voting)
✔️ build-ansible-collection SUCCESS in 10m 19s
✔️ ansible-test-splitter SUCCESS in 3m 59s
✔️ integration-community.aws-1 SUCCESS in 21m 25s
✔️ integration-community.aws-2 SUCCESS in 15m 38s
✔️ integration-community.aws-3 SUCCESS in 15m 48s
✔️ integration-community.aws-4 SUCCESS in 15m 20s
✔️ integration-community.aws-5 SUCCESS in 12m 10s
✔️ integration-community.aws-6 SUCCESS in 15m 14s
✔️ integration-community.aws-7 SUCCESS in 14m 32s
✔️ integration-community.aws-8 SUCCESS in 14m 51s
✔️ integration-community.aws-9 SUCCESS in 16m 11s
✔️ integration-community.aws-10 SUCCESS in 6m 58s
✔️ integration-community.aws-11 SUCCESS in 16m 25s
Skipped 11 jobs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow for aws_ssm plugin option to be provided by an environment variable
1 participant