Details
-
Task
-
Status: Open
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
-
Windows
-
1
-
Needs Assessment
Description
The current module only allows for setting occurrences to a single string value, and only exposes the first value in the manifest generated by puppet resource.
In reality, the V2 API supports a bitmask now instead of the single value supported in the V1 API. This is a problem for a few reasons:
- Users cannot set a combination of weeks to repeat on - for instance first and third
- When managing existing tasks, information may be lost if the task was setup to repeat on different weeks
- The output emitted by puppet resource is wrong and cannot be round-tripped properly.
See https://github.com/puppetlabs/puppetlabs-scheduled_task/commit/d6ba376cf2ad3696adc883c80f0060e3b4bb2ab2 for more information on when this was uncovered
Notice comments like
# HACK: choose only the last week selected for test conversion, as this LOSES information
|
- :WeeksOfMonth => 0b10000,
|
Implementing this will also need to consider :
- The default compatibility level for a task is 1 when left unspecified. However, an array value for occurrence should either - set the compatibility to 2 automatically and emit a warning OR hard fail with a message to the user about compatibility
- The value should be canonicalized / stored into an array in the canonicalize_and_validate helper code
- trigger_spec.rb tests should be updated