[PUP-6516] support the same service name in resources with multiple providers Created: 2016/07/18  Updated: 2018/06/08

Status: Accepted
Project: Puppet
Component/s: Types and Providers
Affects Version/s: PUP 4.5.2
Fix Version/s: None

Type: Improvement Priority: Normal
Reporter: Michal Zubac Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: manage-service
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to PUP-1073 Support common package name in two di... Closed
Team: Coremunity


When I want to use multiple service providers on 1 machine (typically sys-v-init & upstart or systemd), I cannot use Service resource to do that.

For example, I want to replace sys-v-init script by upstart. With code like this:

service { 'abc_init':
  name     => 'abc',
  ensure   => 'stopped',
  provider => 'redhat',
service { 'abc_upstart':
  name     => 'abc',
  ensure   => 'running',
  provider => 'upstart',

I get this error:

Error: Evaluation Error: Error while evaluating a Resource Statement, Cannot alias Service[abc_upstart] to ["abc"] at manifest.pp:7; resource ["Service", "abc"] already declared at manifest.pp:1 at manifest.pp:7:1 on node foo.example.com

For Package resource it is already solved in 4.0.0+ (PUP-1073). Services are another case, when it makes sense as well.

Currently the only way is to use Exec to work around that, but it is not nice to write the command myself, when they are already implemented inside Service type.

Generated at Sun Jan 26 21:21:03 PST 2020 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.