Skip to content

feat(snmp_exporter):add multiple config support - #810

Open
Luatan wants to merge 3 commits into
prometheus-community:mainfrom
Luatan:multiple-config-files
Open

feat(snmp_exporter):add multiple config support#810
Luatan wants to merge 3 commits into
prometheus-community:mainfrom
Luatan:multiple-config-files

Conversation

@Luatan

@Luatan Luatan commented May 31, 2026

Copy link
Copy Markdown
Contributor

Adds support for multiple configuration files. Introduces a seperate variable for the additional files to not break existing configurations.

fixes #212

@github-actions github-actions Bot added enhancement New feature or request roles/snmp_exporter labels May 31, 2026
…rt multiple configuration files

Signed-off-by: Luatan <simon@schmid.zip>
@Luatan
Luatan force-pushed the multiple-config-files branch from 95fd78b to 4a5131c Compare May 31, 2026 02:40
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels May 31, 2026
@epruesse

Copy link
Copy Markdown

It would be great if this could be merged. It makes it far easier to supply auth: sections to snmp_exporter if the one config file doesn't have to be modified.

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

github-actions Bot commented Jul 23, 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/810

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/30007954922

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 c61515b..758f48a 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
@@ -178,6 +178,14 @@ To check whether it is installed, run <code class="code docutils literal notrans
 </thead>
 <tbody>
 <tr class="row-even"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_additional_configs"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-additional-configs"><strong>snmp_exporter_additional_configs</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_additional_configs" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">list</span> / <span class="ansible-option-elements">elements=string</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>List of filepaths to load as configuration files</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">[]</span></code></p>
+</div></td>
+</tr>
+<tr class="row-odd"><td><div class="ansible-option-cell">
 <div class="ansibleOptionAnchor" id="parameter-main--snmp_exporter_binary_install_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-binary-install-dir"><strong>snmp_exporter_binary_install_dir</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_binary_install_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -186,7 +194,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;/usr/local/bin&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_binary_url"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-binary-url"><strong>snmp_exporter_binary_url</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_binary_url" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -194,7 +202,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;https://github.com/{{</span> <span class="pre">_snmp_exporter_repo</span> <span class="pre">}}/releases/download/v{{</span> <span class="pre">snmp_exporter_version</span> <span class="pre">}}/snmp_exporter-{{</span> <span class="pre">snmp_exporter_version</span> <span class="pre">}}.{{</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">}}.tar.gz&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_checksums_url"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-checksums-url"><strong>snmp_exporter_checksums_url</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_checksums_url" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -202,7 +210,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;https://github.com/{{</span> <span class="pre">_snmp_exporter_repo</span> <span class="pre">}}/releases/download/v{{</span> <span class="pre">snmp_exporter_version</span> <span class="pre">}}/sha256sums.txt&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_config_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-config-dir"><strong>snmp_exporter_config_dir</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_config_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -210,7 +218,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;/etc/snmp_exporter&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_config_file"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-snmp-exporter-role-parameter-main-snmp-exporter-config-file"><strong>snmp_exporter_config_file</strong></p>
 <a class="ansibleOptionLink" href="#parameter-main--snmp_exporter_config_file" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
 </div></td>
@@ -218,7 +226,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <p>Otherwise this should contain path to file with custom snmp exporter configuration</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_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 +234,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 +242,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 +251,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 +260,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 +268,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 force-pushed the multiple-config-files branch from d29d114 to 43ddeb1 Compare July 23, 2026 12:27
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 23, 2026
Signed-off-by: Luatan <simon@schmid.zip>
@Luatan
Luatan force-pushed the multiple-config-files branch from 43ddeb1 to 7f08d42 Compare July 23, 2026 12:40
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 23, 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.

snmp_exporter: Add support for multiple config files

2 participants