Skip to content

Conversation

@kuba-orlik
Copy link
Contributor

Fixes #667

The yaml syntax was such that the dependency list was a string ("['python3-apt', 'libcap2-bin'] " — note the whitespace at the end!), not a list, and caused errors described in #667

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2025

Docs Build 📝

Thank you for contributing!✨

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

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

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/_common_role.html b/home/runner/work/ansible/ansible/docsbuild/head/_common_role.html
index 46c59b8..8d1b8a3 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/_common_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/_common_role.html
@@ -412,7 +412,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
 <a class="ansibleOptionLink" href="#parameter-preflight--_common_dependencies" 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>Package dependencies to install</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;{%</span> <span class="pre">if</span> <span class="pre">(ansible_facts['pkg_mgr']</span> <span class="pre">==</span> <span class="pre">'apt')</span> <span class="pre">%}{{</span> <span class="pre">('python-apt'</span> <span class="pre">if</span> <span class="pre">ansible_facts['python_version']</span> <span class="pre">is</span> <span class="pre">version('3',</span> <span class="pre">'&lt;')</span> <span class="pre">else</span> <span class="pre">'python3-apt')</span> <span class="pre">}}</span> <span class="pre">{%</span> <span class="pre">else</span> <span class="pre">%}{%</span> <span class="pre">endif</span> <span class="pre">%}&quot;</span></code></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;{{</span> <span class="pre">['python-apt']</span> <span class="pre">if</span> <span class="pre">ansible_facts['pkg_mgr']</span> <span class="pre">==</span> <span class="pre">'apt'</span> <span class="pre">and</span> <span class="pre">ansible_facts['python_version']</span> <span class="pre">is</span> <span class="pre">version('3',</span> <span class="pre">'&lt;')\n</span>&#160;&#160; <span class="pre">else</span> <span class="pre">['python3-apt']</span> <span class="pre">if</span> <span class="pre">ansible_facts['pkg_mgr']</span> <span class="pre">==</span> <span class="pre">'apt'\n</span>&#160;&#160; <span class="pre">else</span> <span class="pre">[]</span> <span class="pre">}}&quot;</span></code></p>
 </div></td>
 </tr>
 <tr class="row-odd"><td><div class="ansible-option-cell">

Signed-off-by: Kuba Orlik <[email protected]>
@klausi
Copy link

klausi commented Nov 4, 2025

Thanks, works for me! I directly patched this into the installed prometheus role:

cd /path/to/galaxy/ansible_collections/prometheus/prometheus
wget https://patch-diff.githubusercontent.com/raw/prometheus-community/ansible/pull/668.diff
patch -p1 < 668.diff

@SuperQ SuperQ changed the title Fix blackbox dependencies syntax fix(blackbox_exporter): blackbox dependencies syntax Nov 5, 2025
@github-actions github-actions bot added bugfix and removed bugfix labels Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ERROR]: Task failed: Module failed: No package(s) matching '['python3-apt'' available

4 participants