Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifying the class doesn't restart the service #356

Open
mNantern opened this issue Feb 26, 2018 · 0 comments
Open

Notifying the class doesn't restart the service #356

mNantern opened this issue Feb 26, 2018 · 0 comments

Comments

@mNantern
Copy link

After upgrading my java version I notify the class['logstash'] in order to restart it. But it's not working, the service is not restarted:

puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for lst1.dev.hub.docapost.io
Info: Applying configuration version '1519642246'
Notice: /Stage[main]/Java/Package[java]/ensure: created
Info: /Stage[main]/Java/Package[java]: Scheduling refresh of Class[Logstash]
Notice: Applied catalog in 16.96 seconds
systemctl status logstash
● logstash.service - logstash
   Loaded: loaded (/etc/systemd/system/logstash.service; enabled; vendor preset: disabled)
   Active: active (running) since ven. 2018-02-23 08:23:46 CET; 3 days ago

I have to explicitly notify the service['logstash'] and so this doesn't work unfortunately:

class { '::logstash':
    startup_options => $init_defaults_hash,
    version         => $logstash_version,
    manage_repo     => false,
    logstash_user   => $generic_user,
    logstash_group  => $generic_group,
    settings => {
      'path.logs' => "/VAR/logstash/logs",
      'path.data' => "/VAR/logstash/data"
    },
    subscribe => Package['java']
  }

I have to use an ugly workaround:

exec { '/usr/bin/ls /':
    notify      => Service['logstash'],
    subscribe   => Package['java'],
    refreshonly => true
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant