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 conflicts with system service #1158

Closed
fnoop opened this issue Nov 21, 2017 · 0 comments
Closed

Service resource name conflicts with system service #1158

fnoop opened this issue Nov 21, 2017 · 0 comments

Comments

@fnoop
Copy link
Contributor

fnoop commented Nov 21, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.2
  • Ruby: 2.3.3
  • Distribution: Debian 9
  • Module version: master

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

class { 'nginx':
        service_manage  => true,
        service_name    => "maverick-nginx",
    }
service { "nginx":
 ensure => stopped,
 enable => false
}

What are you seeing

Because the puppet-nginx service manifest calls service { 'nginx':, if you want to use puppet-nginx to manage a custom nginx service (eg. 'maverick-nginx' in this instance), you cannot also control the default system nginx service (eg. to turn it off as in the fragment above). This is a perfectly valid scenario.

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Service[system-nginx] to ["nginx"] at /srv/maverick/software/maverick/manifests/init.pp:205; resource ["Service", "nginx"] already declared at /srv/maverick/software/maverick/manifests/puppet-modules/nginx/manifests/service.pp:53 at /srv/maverick/software/maverick/manifests/init.pp:205:13  at /srv/maverick/software/maverick/manifests/maverick-modules/maverick_web/manifests/nginx.pp:26 on node maverick-up.home

What behaviour did you expect instead

Control of both services should be possible.

alexjfisher pushed a commit that referenced this issue Nov 22, 2017
ceonizm pushed a commit to ceonizm/puppet-nginx that referenced this issue Jan 23, 2018
cegeka-jenkins pushed a commit to cegeka/puppet-nginx that referenced this issue Sep 13, 2019
ceonizm pushed a commit to ceonizm/puppet-nginx that referenced this issue Feb 7, 2020
Rubueno pushed a commit to Rubueno/puppet-nginx that referenced this issue Oct 19, 2020
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