Comments (11)
any updates on this?
from ansible-node-exporter.
Did some debugging of ansible.builtin.uri module and found how to solve this. You need to run your playbook with -K or --ask-become-pass (ask for privilege escalation password) and you will be asked for sudo password of your local machine (not target). Seems that ansible.builtin.uri module requires sudo of your local machine somehow.
from ansible-node-exporter.
it crashes the whole python process for me on my mac. Passing -K
does not fix it.
from ansible-node-exporter.
To @sixtus:
If it crashes during multithreading tasks on your mac then it isn't related to this problem and you have to add this line "export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES" to your .zshrc/.bashrc and restart your terminal session
from ansible-node-exporter.
@wowpetr thanks, that fixed the crash, however I need to pass a version, "Get latest release" fails with FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
from ansible-node-exporter.
@sixtus with -K argument and local sudo password provided?
from ansible-node-exporter.
@wowpetr I run into a different problem now, so -K
seems to help. Why I need local sudo rights to run ansible beats me though (and doesn't build confidence)
from ansible-node-exporter.
@sixtus when I was debugging it I could see that get-uri module downloads the github version page locally to parse the latest version and it needs access to stderr which requires sudo (at least it says so).
from ansible-node-exporter.
Running into this issue as well:
node_exporter_version = latest
TASK [cloudalchemy.node_exporter : Get checksum list from github] **********************************************************************************************************************************************************************************
task path: /usr/share/ansible/roles/cloudalchemy.node_exporter/tasks/preflight.yml:99
fatal: [<REDACTED> -> localhost]: FAILED! =>
msg: 'An unhandled exception occurred while running the lookup plugin ''url''. Error was a <class ''ansible.errors.AnsibleError''>, original message: Received HTTP error for https://github.com/prometheus/node_exporter/releases/download/vlatest/sha256sums.txt : HTTP Error 404: Not Found'
Does not exist:
https://github.com/prometheus/node_exporter/releases/download/vlatest/sha256sums.txt
from ansible-node-exporter.
I've faced with same issue.
As I understand, in string https://github.com/cloudalchemy/ansible-node-exporter/blob/master/tasks/preflight.yml#L91), we're trying to override node_exporter_version
variable by using set_fact
.
- name: "Set node_exporter version to {{ _latest_release.json.tag_name[1:] }}"
set_fact:
node_exporter_version: "{{ _latest_release.json.tag_name[1:] }}"
However, set_fact
have low precedence and precedence is more important than the order in which the value is assigned.
For more info please see -> https://stackoverflow.com/questions/27038553/ansible-set-fact-doesnt-change-the-variable-value
Workaround is to create additional variable (i.e. internal variable _node_exporter_version
) which will be used instead of variable node_exporter_version
in steps after "Set node_exporter version to" and add additional step to define this variable for node exporter with predefined version.
Example:
- block:
- name: Get latest release
uri:
url: "https://api.github.com/repos/prometheus/node_exporter/releases/latest"
method: GET
return_content: true
status_code: 200
body_format: json
user: "{{ lookup('env', 'GH_USER') | default(omit) }}"
password: "{{ lookup('env', 'GH_TOKEN') | default(omit) }}"
no_log: "{{ not lookup('env', 'MOLECULE_DEBUG') | bool }}"
register: _latest_release
until: _latest_release.status == 200
retries: 5
- name: "Set internal variable for node_exporter version to {{ _latest_release.json.tag_name[1:] }}"
set_fact:
_node_exporter_version: "{{ _latest_release.json.tag_name[1:] }}"
when:
- node_exporter_version == "latest"
- node_exporter_binary_local_dir | length == 0
delegate_to: localhost
run_once: true
- name: "Set internal variable for node_exporter version to {{ node_exporter_version }}"
set_fact:
_node_exporter_version: "{{ node_exporter_version }}"
when:
- node_exporter_version != "latest"
from ansible-node-exporter.
This role has been deprecated in favor of a the prometheus-community/ansible collection.
from ansible-node-exporter.
Related Issues (20)
- node_exporter_textfile_dir doesn't enable corresponding collector HOT 1
- Unpack node_exporter binary step fails on cluster HOT 3
- With recent release of node_exporter (1.2.2) the role fails to detect version installed. HOT 7
- Unable to find required 'zipinfo' binary in the path HOT 2
- Allow to install node exporter easily without internet HOT 4
- Create password hash on local machine HOT 3
- Encryption not working for basic authentication HOT 5
- new release? HOT 10
- Support for other RHEL-like packages HOT 1
- Refactor: Unnecessary call to github if node_exporter already installed HOT 1
- Still maintained? HOT 8
- tasks/main.yml wrong parameter in import_tasks: install.yml HOT 1
- Create a new release with changes in master branch HOT 4
- PreventHome works only if mount is directly under /home HOT 1
- Role doesn't work with Ansible 7.0.0 HOT 5
- Crash on get checksum list HOT 1
- Is ansible-node-exporter abandoned? No commits have been made since January 2022 (now December 2022) HOT 5
- Node exporter version 1.5.0 systemd unit unable to start HOT 2
- Example code in the README doesn't generate a CSR file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-node-exporter.