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

Noop changes to file ownership generate failures if required User or Group does not exist

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: PUP 3.7.3
    • Fix Version/s: None
    • Component/s: Catalog Application
    • Labels:

      Description

      If a noop run contains File resources, and those resources have pending changes for User or Group ownership, the run will show failures if those User or Group resources don't exist yet.

      Reproduction Case

      • Create the following manifest:

      # noop_test.pp
      file {'/tmp/usertest':
        ensure => present,
        owner => testuser,
      }
       
      file {'/tmp/grouptest':
        ensure => present,
        group => testgroup,
      }
       
      user{'testuser':
        ensure => present,
      }
       
      group{'testgroup':
        ensure => present,
      }
      

      Create the test file:

      touch /tmp/usertest
      touch /tmp/grouptest
      

      Outcome

      A noop application produces errors:

      # puppet apply --noop noop_test.pp
       
      Notice: Compiled catalog for poss-head-master.puppetdebug.vlan in environment production in 1.87 seconds
      Notice: /Stage[main]/Main/User[testuser]/ensure: current_value absent, should be present (noop)
      Error: Could not find user testuser
      Error: /Stage[main]/Main/File[/tmp/usertest]/owner: change from root to testuser failed: Could not find user testuser
      Notice: /Stage[main]/Main/Group[testgroup]/ensure: current_value absent, should be present (noop)
      Error: Could not find group testgroup
      Error: /Stage[main]/Main/File[/tmp/grouptest]/group: change from root to testgroup failed: Could not find group testgroup
      Notice: Applied catalog in 0.08 seconds
      

      Expected Outcome

      The noop run notes that the values would be changed but doesn't produce an error. The error should only happen if Users or Groups are missing when Puppet enforces the change.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                chuck Charlie Sharpsteen
                QA Contact:
                Eric Thompson
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Zendesk Support