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

Windows agents should be able to apply a 'stopped' service resource even if the service doesn't exist

    Details

    • Template:
    • Acceptance Criteria:
      Hide

      Linux says nothing happens, Windows and OS X will error. Not clear which is the better approach, but it should be consistent.

      Show
      Linux says nothing happens, Windows and OS X will error. Not clear which is the better approach, but it should be consistent.
    • Epic Link:
    • Team:
      Platform OS
    • Sprint:
      Platform OS Kanban
    • CS Priority:
      Normal
    • CS Frequency:
      3 - 25-50% of Customers
    • CS Severity:
      2 - Annoyance
    • CS Business Value:
      5 - $$$$$$
    • CS Impact:
      Hide
      Users have a valid case for wanting to ensure a service such as the monitoring example. Another case might be compliance where even if the service is not present you can tell an auditor it gets automatically stopped.

      This should have parity with how it works on linux.
      Show
      Users have a valid case for wanting to ensure a service such as the monitoring example. Another case might be compliance where even if the service is not present you can tell an auditor it gets automatically stopped. This should have parity with how it works on linux.
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      The Windows service provider now returns enable = false, ensure = stopped for nonexistent services, and errors when setting enable = true or ensure = running on them.

      Description

      Linux agents don't seem to have this issue, for example:

      ]# puppet apply -e 'service {"notaservice": ensure => "stopped", enable => false,}'
      Notice: Compiled catalog for pe-201620-master.example.com in environment production in 0.12 seconds
      Notice: Applied catalog in 0.33 seconds
      

      However, on Windows, an attempt to apply the same resource gives:

      PS C:\Users\Administrator> puppet apply -e 'service {"notaservice": ensure => "stopped", enable => false,}'
      Notice: Compiled catalog for windows-agent1 in environment production in 0.03 seconds
      Error: /Stage[main]/Main/Service[notaservice]: Could not evaluate: Cannot get status of notaservice, error was: The specified service does not exist as an installed service. - OpenService: The specified service does not exist as an installed service.
      Wrapped exception:
      The specified service does not exist as an installed service. - OpenService: The specified service does not exist as an installed service.
      Notice: Applied catalog in 0.14 seconds
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  enis.inan Enis Inan
                  Reporter:
                  erik.hansen Erik Hansen
                • Votes:
                  4 Vote for this issue
                  Watchers:
                  14 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: