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

resources cron purge fails if resource's name to be purged matches the title of a different resource

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • None
    • None
    • Catalog Application
    • None
    • Coremunity
    • Needs Assessment
    • Needs Assessment

    Description

      Puppet Version: 6.10.1-1stretch**
      OS Name/Version: Debian stretch

      hi,

      I just discovered some duplicated crontab entries and then after some debugging found that resources cron purge ignores the name of the cron resources.

       

      Reproduction:

      puppet apply the following:

      resources { 'cron':
        purge => true
      }
      cron { 'foo1':
        command => '/bin/true'
      , hour  => 3
      , minute => 3
      }
      

      Actual and expected behavior:

      Puppet removes all crontab entries and creates the foo1 entry.

      # HEADER: This file was autogenerated at 2019-11-05 12:57:26 +0100 by puppet.
      # HEADER: While it can still be managed manually, it is definitely not recommended.
      # HEADER: Note particularly that the comments starting with 'Puppet Name' should
      # HEADER: not be deleted, as doing so could cause duplicate cron jobs.
      # Puppet Name: foo1
      3 3 * * * /bin/true

      now apply the following:

      resources { 'cron':
       purge => true
      }
      cron { 'foo1':
       command => '/bin/true'
      , hour => 3
      , minute => 3
      , name => 'foo2'
      }
      

       

      Actual behavior:

      Puppet just adds the new foo2 cron entry.

      # HEADER: This file was autogenerated at 2019-11-05 12:57:26 +0100 by puppet.
      # HEADER: While it can still be managed manually, it is definitely not recommended.
      # HEADER: Note particularly that the comments starting with 'Puppet Name' should
      # HEADER: not be deleted, as doing so could cause duplicate cron jobs.
      # Puppet Name: foo1
      3 3 * * * /bin/true
      # Puppet Name: foo2
      3 3 * * * /bin/true

      Expected behavior:

      Puppet also removes the foo1 entry since no cron resource with that name exists in the catalog.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mphilipps Maximilian Philipps
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Zendesk Support