HomePhorge

(PUP-1624) cron: move the default value logic from user to target
b0df220a8d9eUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(PUP-1624) cron: move the default value logic from user to target

Crontab is an oddball example for parsedfile resources, because resources don't
end up in actual files, but I/O is indirected through crontab(1) instead.
Therefor, the target property doesn't really apply and maps to the user
property instead, after a fashion - the user that runs the cron task is
determined by which crontab the entry is stored in.

For default values, it was determined that the user property should be
processed before the target property (on type level) and choose the default
(i.e. the user running puppet). The target property would use the value
of user as its default.

This leads to a peculiar situation when target is managed but user is not.
User *will* use its default value then, which will often differ from the
choice made for target. Puppet will then try and bring the user property
in sync with the default value.

To evade this, a default value for the user property should be avoided,
at least for resources that use the crontab provider. The current rules:

  1. The 'user' property uses the user running puppet as default.
  2. When crontab is in use, 'target' uses the 'user' value as default.
  3. For other parsedfile providers, 'target' uses the provider's default.

Instead, apply the following rules:

  1. When crontab is in use, 'user' has no default value.
  2. Otherwise, the default is the user running puppet.
  3. If crontab is in use and there is a 'user' value, 'target' defaults to that.
  4. If crontab is in use and there is no 'user' value, 'target' defaults to the

user running puppet.

  1. For other parsedfile providers, 'target' uses the provider's default.

Details

Provenance
Felix Frank <Felix.Frank@Alumni.TU-Berlin.de>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU06089333119f: (PUP-1585) amend unit test to match corrected behavior
Branches
Unknown
Tags
Unknown

Event Timeline

Felix Frank <Felix.Frank@Alumni.TU-Berlin.de> committed rPUb0df220a8d9e: (PUP-1624) cron: move the default value logic from user to target (authored by Felix Frank <Felix.Frank@Alumni.TU-Berlin.de>).Mar 3 2014, 11:14 PM