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

Make Prometheus daemon restart/reload with sudo privileges. #77

Merged

Conversation

swesterveld
Copy link
Contributor

I'm trying to include the cloudalchemy.prometheus role from our own monitoring role like this:

- name: Install Prometheus Server
  become: yes
  when: act_as_prometheus_server == true

  include_role:
    name: cloudalchemy.prometheus
  vars:
  [...]

This results in a fatal error, at the point when running the handler that should restart prometheus:

RUNNING HANDLER [cloudalchemy.prometheus : restart prometheus] **********************************************************************************************************************
fatal: [monitor]: FAILED! => {"changed": false, "msg": "failure 1 during daemon-reload: Failed to execute operation: Interactive authentication required.\n"}

The service could only be restarted with sudo-privileges, which in the case of an include_role or import_role won't get picked up correctly by the handler responsible for the service-restart/-reload.
This PR will make sure that the prometheus.service will be restarted with the correct privileges.

@paulfantom paulfantom merged commit af86b2f into cloudalchemy:master Feb 14, 2018
@paulfantom
Copy link
Member

Thanks!

@swesterveld swesterveld deleted the fix_daemon_reload_for_role_include branch February 14, 2018 09:14
slomo pushed a commit to slomo/ansible-prometheus that referenced this pull request Dec 12, 2018
…_for_role_include

Make Prometheus daemon restart/reload with sudo privileges.
@lock
Copy link

lock bot commented Mar 25, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants