Skip to content

Pre Move Hook #5

@sylr

Description

@sylr

Hi,

This is a nice playbook!

It would be nice if we could have a pre-move hook command because if version do not match I have this error because the target file location is in use:

[Errno 26] Text file busy: '/usr/local/bin/prometheus-node-exporter'

E.G:

- name: Install prometheus-node-exporter
  quera.github.install_from_github:
    repo: prometheus/node_exporter
    tag: "{{ prometheus.node_exporter.version | default('v1.9.1') }}"
    asset_regex: node_exporter-.*\.tar\.gz
    version_command: /usr/local/bin/prometheus-node-exporter --version | head -n1 | sed -e 's/.*\([0-9]\.[0-9]\.[0-9]\).*/v\1/g'
    move_rules:
    - src_regex: .*/node_exporter
      dst: /usr/local/bin/prometheus-node-exporter
      mode: 0755
      pre_move_command: systemctl stop prometheus-node-exporter.service
  become: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions