Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

fix #230 #233

Merged
merged 2 commits into from
Aug 11, 2021
Merged

fix #230 #233

merged 2 commits into from
Aug 11, 2021

Conversation

agcandil
Copy link

@agcandil agcandil commented Aug 6, 2021

Fix PR: 231
Closes #230
Summary
The object __node_exporter_current_version_output.stderr_lines is an empty list which causes the following bug in the tasks/main.yml/install.yml conditional. This bug happens only after provisioning the role for the first time.

TASK [cloudalchemy.node_exporter : Create the node_exporter group] ***********************************************************
fatal: [infra-mon-1]: FAILED! => 
  msg: |-
    The conditional check '( not __node_exporter_is_installed.stat.exists ) or ( __node_exporter_current_version_output.stderr_lines[0].split(" ")[2] != node_exporter_version ) or ( node_exporter_binary_local_dir | length > 0 )' failed. The error was: error while evaluating conditional (( not __node_exporter_is_installed.stat.exists ) or ( __node_exporter_current_version_output.stderr_lines[0].split(" ")[2] != node_exporter_version ) or ( node_exporter_binary_local_dir | length > 0 )): list object has no element 0
  
    The error appears to be in '/home/dan/.ansible/roles/cloudalchemy.node_exporter/tasks/install.yml': line 2, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.
  
    The offending line appears to be:
  
    ---
    - name: Create the node_exporter group
      ^ here

Added backward compatiblity checking stdout and stderr

@github-actions github-actions bot added the area/tasks Logic behind ansible role label Aug 6, 2021
@adamcstephens
Copy link

I can confirm this fixes the issue for me.

@SuperQ SuperQ changed the title fix https://github.com/cloudalchemy/ansible-node-exporter/issues/230 fix #230 Aug 9, 2021
Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@SuperQ
Copy link
Collaborator

SuperQ commented Aug 10, 2021

If you rebase the change against HEAD, it should fix the test.

@agcandil
Copy link
Author

agcandil commented Aug 11, 2021

Thanks, Tests fixed!!!

@SuperQ SuperQ merged commit 18ff8f8 into cloudalchemy:master Aug 11, 2021
@vosdev
Copy link

vosdev commented Sep 14, 2021

@SuperQ Can you release a new version? The role is basically unusable until this PR is merged.

@rgdev
Copy link

rgdev commented Oct 28, 2021

Any updates on an eventual 2.0.1 release with this hotfix ? Role is unusable right now without manual yaml editing :/

@ben-wallis
Copy link

You can work around the lack of an official release by using the following in requirements.yml to install the role from the latest git commit:

  - src: git+https://github.com/cloudalchemy/ansible-node-exporter
    version: 5c049ffdd1918752d9d078193c2ddd003d5332ac

You'll also need to use ansible-node-exporter instead of cloudalchemy.node_exporter when importing the role to a playbook as the role name is different when sourced from git.

@SuperQ
Copy link
Collaborator

SuperQ commented Nov 10, 2021

Sorry, I've been behind on debugging some issues with the release process.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/tasks Logic behind ansible role
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when reinstall
7 participants