Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6516

support the same service name in resources with multiple providers

    Details

    • Type: Improvement
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 4.5.2
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
    • Template:
    • Team:
      Coremunity

      Description

      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.

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  contact@mighq.net Michal Zubac
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated: