[PUP-6516] support the same service name in resources with multiple providers Created: 2016/07/18  Updated: 2020/03/04  Resolved: 2020/03/04

Status: Closed
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: Won't Do 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: Night's Watch


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.

Comment by Josh Cooper [ 2020/03/04 ]

Trying to manage services across different providers seems like asking for trouble. I'm going to close this, please reopen if it's still a concern.

Generated at Mon Sep 28 05:23:37 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.