diff options
author | Bobosila Victor <victor.bobosila@puppet.com> | 2021-10-04 11:06:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-04 11:06:38 +0300 |
commit | 74e9d916d182df8a6594403582a8cc9e19dd55c0 (patch) | |
tree | c3070ac7809f3cf0ea04ce83622ae438efbd8203 /REFERENCE.md | |
parent | 4c72fb204bfc98e5d9dd4bff210c9be8178f1258 (diff) | |
parent | dd42efd5323314047d2c44e02f2f7e3472954697 (diff) | |
download | puppet-cron_core-74e9d916d182df8a6594403582a8cc9e19dd55c0.tar.gz puppet-cron_core-74e9d916d182df8a6594403582a8cc9e19dd55c0.tar.bz2 |
Merge pull request #44 from joshcooper/bump_json
(maint) Bump templates to 2.2.0
Diffstat (limited to 'REFERENCE.md')
-rw-r--r-- | REFERENCE.md | 176 |
1 files changed, 97 insertions, 79 deletions
diff --git a/REFERENCE.md b/REFERENCE.md index afe98bb..6b7b91f 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1,55 +1,28 @@ # Reference + <!-- DO NOT EDIT: This document was generated by Puppet Strings --> ## Table of Contents -**Resource types** +### Resource types -* [`cron`](#cron): Installs and manages cron jobs. Every cron resource created by Puppet requires a command and at least one periodic attribute (hour, minute, m +* [`cron`](#cron): Installs and manages cron jobs. ## Resource types -### cron +### <a name="cron"></a>`cron` -Installs and manages cron jobs. Every cron resource created by Puppet -requires a command and at least one periodic attribute (hour, minute, -month, monthday, weekday, or special). While the name of the cron job is -not part of the actual job, the name is stored in a comment beginning with -`# Puppet Name: `. These comments are used to match crontab entries created -by Puppet with cron resources. +Every cron resource created by Puppet requires a command and at least one +periodic attribute (hour, minute, month, monthday, weekday, or special). While +the name of the cron job is not part of the actual job, the name is stored in a +comment beginning with `# Puppet Name: `. These comments are used to match +crontab entries created by Puppet with cron resources. If an existing crontab entry happens to match the scheduling and command of a cron resource that has never been synced, Puppet defers to the existing crontab entry and does not create a new entry tagged with the `# Puppet Name: ` comment. -Example: - - cron { 'logrotate': - command => '/usr/sbin/logrotate', - user => 'root', - hour => 2, - minute => 0, - } - -Note that all periodic attributes can be specified as an array of values: - - cron { 'logrotate': - command => '/usr/sbin/logrotate', - user => 'root', - hour => [2, 4], - } - -...or using ranges or the step syntax `*/2` (although there's no guarantee -that your `cron` daemon supports these): - - cron { 'logrotate': - command => '/usr/sbin/logrotate', - user => 'root', - hour => ['2-4'], - minute => '*/10', - } - **Important:** _The Cron type will not reset parameters that are removed from a manifest_. For example, removing a `minute => 10` parameter will not reset the minute component of the associated cronjob to `*`. @@ -61,17 +34,46 @@ sync with manifest entries. `user` property of a cron resource, then the cron resource will autorequire that user. -#### Properties +#### Examples -The following properties are available in the `cron` type. +##### -##### `ensure` +```puppet -Valid values: present, absent +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => 2, + minute => 0, +} +``` -The basic property that the resource should be in. +##### Note that all periodic attributes can be specified as an array of values: + +```puppet + +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => [2, 4], +} +``` -Default value: present +##### ...or using ranges or the step syntax `*/2` (although there's no guarantee that your `cron` daemon supports these): + +```puppet + +cron { 'logrotate': + command => '/usr/sbin/logrotate', + user => 'root', + hour => ['2-4'], + minute => '*/10', +} +``` + +#### Properties + +The following properties are available in the `cron` type. ##### `command` @@ -84,32 +86,40 @@ user's environment is desired it should be sourced manually. All cron parameters support `absent` as a value; this will remove any existing values for that field. -##### `special` +##### `ensure` -A special value such as 'reboot' or 'annually'. -Only available on supported systems such as Vixie Cron. -Overrides more specific time of day/week settings. -Set to 'absent' to make puppet revert to a plain numeric schedule. +Valid values: `present`, `absent` -##### `minute` +The basic property that the resource should be in. -The minute at which to run the cron job. -Optional; if specified, must be between 0 and 59, inclusive. +Default value: `present` + +##### `environment` + +Any environment settings associated with this cron job. They +will be stored between the header and the job in the crontab. There +can be no guarantees that other, earlier settings will not also +affect a given cron job. + + +Also, Puppet cannot automatically determine whether an existing, +unmanaged environment setting is associated with a given cron +job. If you already have cron jobs with environment settings, +then Puppet will keep those settings in the same place in the file, +but will not associate them with a specific job. + +Settings should be specified exactly as they should appear in +the crontab, like `PATH=/bin:/usr/bin:/usr/sbin`. ##### `hour` The hour at which to run the cron job. Optional; if specified, must be between 0 and 23, inclusive. -##### `weekday` - -The weekday on which to run the command. Optional; if specified, -must be either: - -- A number between 0 and 7, inclusive, with 0 or 7 being Sunday -- The name of the day, such as 'Tuesday'. +##### `minute` -Day ranges can only be numeric; e.g. '1-5' for weekdays, but not 'Mon-Fri'. +The minute at which to run the cron job. +Optional; if specified, must be between 0 and 59, inclusive. ##### `month` @@ -124,22 +134,24 @@ must be either: The day of the month on which to run the command. Optional; if specified, must be between 1 and 31. -##### `environment` +##### `special` -Any environment settings associated with this cron job. They -will be stored between the header and the job in the crontab. There -can be no guarantees that other, earlier settings will not also -affect a given cron job. +A special value such as 'reboot' or 'annually'. +Only available on supported systems such as Vixie Cron. +Overrides more specific time of day/week settings. +Set to 'absent' to make puppet revert to a plain numeric schedule. +##### `target` -Also, Puppet cannot automatically determine whether an existing, -unmanaged environment setting is associated with a given cron -job. If you already have cron jobs with environment settings, -then Puppet will keep those settings in the same place in the file, -but will not associate them with a specific job. +The name of the crontab file in which the cron job should be stored. -Settings should be specified exactly as they should appear in -the crontab, like `PATH=/bin:/usr/bin:/usr/sbin`. +This property defaults to the value of the `user` property if set, the +user running Puppet or `root`. + +For the default crontab provider, this property is functionally +equivalent to the `user` property and should be avoided. In particular, +setting both `user` and `target` to different values will result in +undefined behavior. ##### `user` @@ -152,23 +164,24 @@ This property defaults to the user running Puppet or `root`. The default crontab provider executes the system `crontab` using the user account specified by this property. -##### `target` +##### `weekday` -The name of the crontab file in which the cron job should be stored. +The weekday on which to run the command. Optional; if specified, +must be either: -This property defaults to the value of the `user` property if set, the -user running Puppet or `root`. +- A number between 0 and 7, inclusive, with 0 or 7 being Sunday +- The name of the day, such as 'Tuesday'. -For the default crontab provider, this property is functionally -equivalent to the `user` property and should be avoided. In particular, -setting both `user` and `target` to different values will result in -undefined behavior. +Day ranges can only be numeric; e.g. '1-5' for weekdays, but not 'Mon-Fri'. #### Parameters The following parameters are available in the `cron` type. -##### `name` +* [`name`](#name) +* [`provider`](#provider) + +##### <a name="name"></a>`name` namevar @@ -180,3 +193,8 @@ against specified jobs (and Puppet adds a comment to cron jobs it adds), but it is at least possible that converting from unmanaged jobs to managed jobs might require manual intervention. +##### <a name="provider"></a>`provider` + +The specific backend to use for this `cron` resource. You will seldom need to specify this --- Puppet will usually +discover the appropriate provider for your platform. + |