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

Migration 0.15 to 0.19 fails #153

@vosdev

Description

@vosdev

What happened?
Upgraded the role from 0.15 to 0.19. Role asserts that node-exporter is already installed because /usr/local/bin/node_exporter exists and therefore skips the install.yml tasks. The user is now different from what it was before and fails creating/chowning the textfile collector dir because the new user/group does not exist.

TASK [node-exporter : Create textfile collector dir] ********
fatal: [focal-dev]: FAILED! => changed=false
  gid: 998
  group: _node-exporter
  mode: '0775'
  msg: 'chown failed: failed to look up user node-exp'
  owner: _node-exporter
  path: /var/run/node_exporter
  size: 40
  state: directory
  uid: 997

Did you expect to see some different?

How to reproduce it (as minimally and precisely as possible):
Run the role with version 0.19 on hosts where node-exporter was previously installed using version 0.18 or older.

Environment

  • Role version:

    - cloudalchemy.node-exporter, 0.19.0

  • Ansible version information:

ansible 2.8.5
  config file = /var/lib/ansible/ansible.cfg
  configured module search path = ['/home/vos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.7/dist-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.3 (default, Apr  3 2019, 05:39:12) [GCC 8.3.0]
  • Variables:
    My variables unchanged from 0.15:
---

node_exporter_version: 0.18.1
node_exporter_system_group: "_node-exporter"

node_exporter_textfile_dir: "/var/run/node_exporter"

node_exporter_enabled_collectors:
  - textfile:
      directory: "{{ node_exporter_textfile_dir }}"

node_exporter_disabled_collectors:
  - systemd
  • Ansible playbook execution Logs:
PLAY [Manage Node Exporter] ***************************************************************************************************************************
TASK [Gathering Facts] ********************************************************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Assert usage of systemd as an init system] **************************************************************************************
ok: [focal-dev] => changed=false
  msg: All assertions passed

TASK [node-exporter : Get systemd version] ************************************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Set systemd version fact] *******************************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Naive assertion of proper listen address] ***************************************************************************************
ok: [focal-dev] => changed=false
  msg: All assertions passed

TASK [node-exporter : Assert collectors are not both disabled and enabled at the same time] ***********************************************************
ok: [focal-dev] => (item=systemd) => changed=false
  ansible_loop_var: item
  item: systemd
  msg: All assertions passed

TASK [node-exporter : Check if node_exporter is installed] ********************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Gather currently installed node_exporter version (if any)] **********************************************************************
ok: [focal-dev]

TASK [node-exporter : Get checksum list from github] **************************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Get checksum for amd64 architecture] ********************************************************************************************
ok: [focal-dev] => (item=b2503fd932f85f4e5baf161268854bf5d22001869b84f00fd2d1f57b51b72424  node_exporter-0.18.1.linux-amd64.tar.gz)

TASK [node-exporter : Copy the Node Exporter systemd service file] ************************************************************************************
ok: [focal-dev]

TASK [node-exporter : Create textfile collector dir] **************************************************************************************************
fatal: [focal-dev]: FAILED! => changed=false
  gid: 998
  group: _node-exporter
  mode: '0775'
  msg: 'chown failed: failed to look up user node-exp'
  owner: _node-exporter
  path: /var/run/node_exporter
  size: 40
  state: directory
  uid: 997

PLAY RECAP ********************************************************************************************************************************************
focal-dev                  : ok=11   changed=0    unreachable=0    failed=1    skipped=11   rescued=0    ignored=0

Anything else we need to know?:
I can work around this by removing /usr/local/bin/node_exporter on all my hosts so that the install.yml gets called but that is not a "clean" upgrade path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions