-
Notifications
You must be signed in to change notification settings - Fork 140
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
feature: allow downloading of package by remote host #499
base: main
Are you sure you want to change the base?
Conversation
c693bde
to
10638f6
Compare
Docs Build 📝Thank you for contribution!✨ The docs for this PR have been published here: You can compare to the docs for the The docsite for this PR is also available for download as an artifact from this run: File changes: Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/ansible/ansible/docsbuild/base/node_exporter_role.html b/home/runner/work/ansible/ansible/docsbuild/head/node_exporter_role.html
index 11c04c2..dd9dbd1 100644
--- a/home/runner/work/ansible/ansible/docsbuild/base/node_exporter_role.html
+++ b/home/runner/work/ansible/ansible/docsbuild/head/node_exporter_role.html
@@ -249,6 +249,14 @@ 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--node_exporter_remote_download"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-remote-download"><strong>node_exporter_remote_download</strong></p>
+<a class="ansibleOptionLink" href="#parameter-main--node_exporter_remote_download" 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>Determines if the node exporter package archive is downloaded and extracted on local (false) or remote host (true)</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">true</span></code></p>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--node_exporter_system_group"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-system-group"><strong>node_exporter_system_group</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_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>
@@ -257,7 +265,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">"node-exp"</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--node_exporter_system_user"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-system-user"><strong>node_exporter_system_user</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_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>
@@ -266,7 +274,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">"node-exp"</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--node_exporter_textfile_dir"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-textfile-dir"><strong>node_exporter_textfile_dir</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_exporter_textfile_dir" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -276,7 +284,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">"/var/lib/node_exporter"</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--node_exporter_tls_server_config"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-tls-server-config"><strong>node_exporter_tls_server_config</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_exporter_tls_server_config" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">dictionary</span></p>
</div></td>
@@ -284,7 +292,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
<p>Keys and values are the same as in <a class="reference external" href="https://prometheus.io/docs/prometheus/latest/configuration/https/">node_exporter docs</a>.</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--node_exporter_version"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-version"><strong>node_exporter_version</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_exporter_version" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -292,7 +300,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">"1.8.2"</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--node_exporter_web_disable_exporter_metrics"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-web-disable-exporter-metrics"><strong>node_exporter_web_disable_exporter_metrics</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_exporter_web_disable_exporter_metrics" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -304,7 +312,7 @@ To check whether it is installed, run <code class="code docutils literal notrans
</ul>
</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--node_exporter_web_listen_address"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-web-listen-address"><strong>node_exporter_web_listen_address</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_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>
@@ -312,7 +320,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">"0.0.0.0:9100"</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--node_exporter_web_telemetry_path"></div><p class="ansible-option-title" id="ansible-collections-prometheus-prometheus-node-exporter-role-parameter-main-node-exporter-web-telemetry-path"><strong>node_exporter_web_telemetry_path</strong></p>
<a class="ansibleOptionLink" href="#parameter-main--node_exporter_web_telemetry_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I think the _common_delegate_to_localhost
variable name is a bit too generic, how about _common_remote_download
and node_exporter_remote_download
etc. instead?
Also I think we should implement this in all the roles at once rather than just for the node_exporter.
Is there some efficient way to test this? I tested node_exporter (by hand, locally) but I don't think I'll be able to test all 20+ roles which rely on _common. |
10638f6
to
19cb70e
Compare
19cb70e
to
b793b2b
Compare
b793b2b
to
5acb13c
Compare
Currently node_exporter install always downloads the package on the localhost and unpacks it there then uploads it to the remote host. In the case the ansible controller is at the other end of a thin network pipe, or if it may not even have access to the package URL, it may be desirable to download and unpack it on the remote host instead. This change adds that ability as an optional behavior to _common/install and wires it up for use by node_exporter, using the node_exporter_remote_download variable. The default for node exporter and the behavior for any other roles remains the same as before: delegate to localhost. Fixes prometheus-community#389. Signed-off-by: Travis Downs <[email protected]>
5acb13c
to
f686f1b
Compare
Awesome. LGTM |
Currently node_exporter install always downloads the package on the localhost and unpacks it there then uploads it to the remote host.
In the case the ansible controller is at the other end of a thin network pipe, or if it may not even have access to the package URL, it may be desirable to download and unpack it on the remote host instead.
This change adds that ability as an optional behavior to _common/install and wires it up for use by node_exporter, using the node_exporter_localhost_download variable. The default for node exporter and any other binaries remains the same as before: delegate to localhost.
Fixes #389.