voxpupuli / puppet-prometheus

Puppet module for prometheus
https://forge.puppet.com/puppet/prometheus
Apache License 2.0
60 stars 240 forks source link

Module breaks services on Amazon Linux 2 #510

Open jaxxstorm opened 3 years ago

jaxxstorm commented 3 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Include the module and set the init_style:

class { 'prometheus':
    init_style => 'systemd',
}

What are you seeing

When this module is added to my puppet configuration, it actually appears to break the service provider on other modules. Here's an example of nginx failing to start properly:

    forum-web-arm64: Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/sites-enabled]/ensure: created
    forum-web-arm64: Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/streams-enabled]/ensure: created
    forum-web-arm64: Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/streams-available]/ensure: created
    forum-web-arm64: Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/nginx.conf]/content: content changed '{sha256}24ede949f59d8c03920908a96cd73d20019d2ca998f2fb62d4cba2250790d08c' to '{sha256}2af8d5eedf889a75ad3c548eb40e61f9f8f6774f02b315877874ecd1e37a7849'
==> forum-web-arm64: Error: Services must specify a start command or a binary
==> forum-web-arm64: Error: /Stage[main]/Nginx::Service/Service[nginx]/ensure: change from 'stopped' to 'running' failed: Services must specify a start command or a binary
    forum-web-arm64: Notice: /Stage[main]/Nginx::Config/File[/etc/nginx/mime.types]/content: content changed '{sha256}7f0b9e0c2320db6882b6d0db1cb3d28c41dd4ff0d1c6e17798ff19668f412598' to '{sha256}64956c0bfe2399b9c26db37d2731ecd221bf5c0b5d47e7f0ca99461c51c4e5cf'

What behaviour did you expect instead

Other services to start correctly

Any additional information you'd like to impart

It appears the amazon linux 2 service provider isn't detected correctly, so I have to explicitly set the init_style

If I remove the puppet-prometheus module from my modulepath, everything works correctly. I can't figure out where this is coming from.

bastelfreak commented 3 years ago

hey, thanks for raising this issue. just from your output it's hard to say if the prometheus module is triggering this or another side effect. However, I just fixed a bug that messed around with the init system detection: https://github.com/voxpupuli/puppet-prometheus/pull/511. can you see if this fixes your issue?