Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
PUP 3.7.3
-
Coremunity
-
Coremunity Kanban
-
Bug Fix
-
Puppet will now correctly report when a file's owner or group would change in noop mode even if the owner or group would be created in the same run.
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.