Skip to content

feat(snmp_exporter):add support for config.expand-environment-variables flag - #811

Open
Luatan wants to merge 2 commits into
prometheus-community:mainfrom
Luatan:expand-environment-variables
Open

feat(snmp_exporter):add support for config.expand-environment-variables flag#811
Luatan wants to merge 2 commits into
prometheus-community:mainfrom
Luatan:expand-environment-variables

Conversation

@Luatan

@Luatan Luatan commented May 31, 2026

Copy link
Copy Markdown
Contributor

Adds support to enable the config.expand-environment-variables flag to be able to pass environment variables from proemtheus directly.

@github-actions github-actions Bot added enhancement New feature or request roles/snmp_exporter labels May 31, 2026

@gardar gardar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.
Please add the new option to the argument specs of the role too.

@Luatan
Luatan force-pushed the expand-environment-variables branch from d3b2813 to ef29ed6 Compare July 10, 2026 06:33
@Luatan
Luatan force-pushed the expand-environment-variables branch from 28c2a9f to e6b73b1 Compare July 10, 2026 06:41
@Luatan

Luatan commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the PR. Please add the new option to the argument specs of the role too.

Hey Gardar,
sure. Added.

Thanks

@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Docs Build 📝

Thank you for contributing!✨

The docs for this PR have been published here:
https://prometheus-community.github.io/ansible/pr/811

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

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

File changes:

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/ansible/ansible/docsbuild/base/snmp_exporter_role.html b/home/runner/work/ansible/ansible/docsbuild/head/snmp_exporter_role.html
index 8d242e4..579c9e6 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/snmp_exporter_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/snmp_exporter_role.html
@@ -219,6 +219,15 @@ To check whether it is installed, run <code class="code docutils literal notrans
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_expand_environment_variables"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-expand-environment-variables"><strong>snmp_exporter_expand_environment_variables</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_expand_environment_variables" 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>allows passing environment variables into some fields of the configuration file.</p>
+<p>The username, password &amp; priv_password fields in the auths section are supported.</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">false</span></code></p>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_local_cache_path"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-local-cache-path"><strong>snmp_exporter_local_cache_path</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_local_cache_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -226,7 +235,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <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;/tmp/snmp_exporter-{{</span> <span class="pre">ansible_facts['system']</span> <span class="pre">|</span> <span class="pre">lower</span> <span class="pre">}}-{{</span> <span class="pre">_snmp_exporter_go_ansible_arch</span> <span class="pre">}}/{{</span> <span class="pre">snmp_exporter_version</span> <span class="pre">}}&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_log_level"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-log-level"><strong>snmp_exporter_log_level</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_log_level" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -234,7 +243,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <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;info&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_system_group"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-system-group"><strong>snmp_exporter_system_group</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_system_group" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -243,7 +252,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <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;snmp-exp&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_system_user"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-system-user"><strong>snmp_exporter_system_user</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_system_user" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -252,7 +261,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <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;snmp-exp&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_version"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-version"><strong>snmp_exporter_version</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_version" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -260,7 +269,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <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;0.30.1&quot;</span></code></p>
 </div></td>
 </tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_web_listen_address"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-web-listen-address"><strong>snmp_exporter_web_listen_address</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_web_listen_address" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>

@Luatan
Luatan requested a review from gardar July 11, 2026 23:02
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 24, 2026
…rgument specs

Signed-off-by: Luatan <simon@schmid.zip>
@Luatan
Luatan force-pushed the expand-environment-variables branch from 1d8f31b to b4a9591 Compare July 24, 2026 11:25
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants