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

service resource name 'collectd' should be renamed #688

Closed
fnoop opened this issue Jul 25, 2017 · 5 comments
Closed

service resource name 'collectd' should be renamed #688

fnoop opened this issue Jul 25, 2017 · 5 comments
Labels
bug Something isn't working

Comments

@fnoop
Copy link

fnoop commented Jul 25, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.0.0
  • Ruby: 2.1.5p273
  • Distribution: Raspbian Jessie
  • Module version: 5.3.0

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

    class { "collectd":
        purge           => true,
        recurse         => true,
        purge_config    => true,
        minimum_version => '5.4',
        manage_service  => true,
        service_name   => 'maverick-collectd',
    } ->
    service_wrapper { "collectd":
        ensure          => stopped,
        enable          => false,
    }

What are you seeing

If I set the service_name to be a custom service, I cannot then also control the collectd system service.

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Service[collectd] is already declared in file /srv/maverick/software/maverick/manifests/puppet-modules/collectd/manifests/service.pp:9; cannot redeclare at /srv/maverick/software/maverick/manifests/init.pp:176 at /srv/maverick/software/maverick/manifests/init.pp:176:9  at /srv/maverick/software/maverick/manifests/maverick-modules/maverick_analysis/manifests/collect.pp:28 on node maverick-raspberry.home

What behaviour did you expect instead

I expect to be able to control 'collectd' system service as normal.

Output log

Any additional information you'd like to impart

This is because the name of the module service resource is set to 'collectd', so conflicting with any other use of the 'collectd' service. It could be renamed to something like 'collectd_service' to not clash.

@fnoop
Copy link
Author

fnoop commented Jul 25, 2017

There are a lot of resources that notify the service collectd:

[dev] [mav@maverick-raspberry ~/software/maverick/manifests/puppet-modules/collectd/manifests]$ grep -r collectd |grep Service
plugin/write_graphite.pp:        notify         => Service['collectd'],
plugin/network/server.pp:    notify  => Service['collectd'],
plugin/network/listener.pp:    notify  => Service['collectd'],
plugin/filter/chain.pp:    notify         => Service['collectd'],
plugin/rabbitmq.pp:    notify  => Service['collectd'],
plugin/exec.pp:    notify         => Service['collectd'],
plugin/genericjmx.pp:    notify         => Service['collectd'],
plugin/filecount/directory.pp:    notify  => Service['collectd'],
plugin/snmp/data.pp:    notify  => Service['collectd'];
plugin/snmp/host.pp:    notify  => Service['collectd'];
plugin/apache/instance.pp:    notify  => Service['collectd'],
plugin/processes.pp:    notify         => Service['collectd'],
plugin/aggregation/aggregator.pp:    notify  => Service['collectd'],
plugin/python.pp:    notify         => Service['collectd'],
plugin/curl_json.pp:      notify  => Service['collectd'],
plugin/dbi.pp:    notify         => Service['collectd'],
plugin/mysql/database.pp:    notify  => Service['collectd'],
plugin/filter.pp:    notify  => Service['collectd'],
plugin/chain.pp:    notify  => Service['collectd'],
plugin/python/module.pp:      notify  => Service['collectd'],
plugin/postgresql.pp:    notify         => Service['collectd'],
plugin/tail/file.pp:    notify  => Service['collectd'],
plugin/curl/page.pp:    notify  => Service['collectd'],
plugin.pp:    notify  => Service['collectd'],
plugin.pp:    notify => Service['collectd'],
plugin.pp:      notify => Service['collectd'],
typesdb.pp:    notify         => Service['collectd'],

@fnoop
Copy link
Author

fnoop commented Dec 4, 2017

@pcheliniy Do you not understand this or not agree with it? It's a valid problem.

fnoop added a commit to fnoop/puppet-collectd that referenced this issue Dec 4, 2017
@juniorsysadmin juniorsysadmin added the bug Something isn't working label Dec 4, 2017
@pcheliniy
Copy link

@fnoop I don't see this as a problem.
I'm not against such a possibility to change service name, but certainly not as the default behavior with a name different from 'collectd'.

@fnoop fnoop changed the title service name 'collectd' should be renamed service resource name 'collectd' should be renamed Dec 5, 2017
@fnoop
Copy link
Author

fnoop commented Dec 5, 2017

@pcheliniy That's not what this is about - this is about the puppet resource name, not the service name itself. I've changed the issue title to be clearer.

@pcheliniy
Copy link

@fnoop Thank you, sorry for that misunderstood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants