Class: Ansible::Ruby::Modules::Cron

Inherits:
Base show all
Defined in:
lib/ansible/ruby/modules/generated/core/system/cron.rb

Overview

Use this module to manage crontab and environment variables entries. This module allows you to create environment variables and named crontab entries, update, or delete them. When crontab jobs are managed: the module includes one line with the description of the crontab entry C(“#Ansible: <name>”) corresponding to the “name” passed to the module, which is used by future ansible/module calls to find/check the state. The “name” parameter should be unique, and changing the “name” value will result in a new cron task being created (or a different one being removed). When environment variables are managed: no comment line is added, but, when the module needs to find/check the state, it uses the “name” parameter to find the environment variable definition line.

Instance Method Summary collapse

Methods inherited from Base

#ansible_name, #to_h

Methods inherited from Ansible::Ruby::Models::Base

attr_option, attr_options, attribute, #initialize, remove_existing_validations, #to_h, validates

Constructor Details

This class inherits a constructor from Ansible::Ruby::Models::Base

Instance Method Details

#backupBoolean?

Returns If set, create a backup of the crontab before it is modified. The location of the backup is returned in the C(backup_file) variable by this module.

Returns:

  • (Boolean, nil)

    If set, create a backup of the crontab before it is modified. The location of the backup is returned in the C(backup_file) variable by this module.



33
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 33

attribute :backup

#cron_fileString?

Returns If specified, uses this file instead of an individual user’s crontab. If this is a relative path, it is interpreted with respect to /etc/cron.d. (If it is absolute, it will typically be /etc/crontab). To use the C(cron_file) parameter you must specify the C(user) as well.

Returns:

  • (String, nil)

    If specified, uses this file instead of an individual user’s crontab. If this is a relative path, it is interpreted with respect to /etc/cron.d. (If it is absolute, it will typically be /etc/crontab). To use the C(cron_file) parameter you must specify the C(user) as well.



29
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 29

attribute :cron_file

#dayString?

Returns Day of the month the job should run ( 1-31, *, */2, etc ).

Returns:

  • (String, nil)

    Day of the month the job should run ( 1-31, *, */2, etc )



45
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 45

attribute :day

#disabledBoolean?

Returns If the job should be disabled (commented out) in the crontab. Only has effect if state=present.

Returns:

  • (Boolean, nil)

    If the job should be disabled (commented out) in the crontab. Only has effect if state=present



65
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 65

attribute :disabled

#env:yes, ...

Returns If set, manages a crontab’s environment variable. New variables are added on top of crontab. “name” and “value” paramenters are the name and the value of environment variable.

Returns:

  • (:yes, :no, nil)

    If set, manages a crontab’s environment variable. New variables are added on top of crontab. “name” and “value” paramenters are the name and the value of environment variable.



69
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 69

attribute :env

#hourString?

Returns Hour when the job should run ( 0-23, *, */2, etc ).

Returns:

  • (String, nil)

    Hour when the job should run ( 0-23, *, */2, etc )



41
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 41

attribute :hour

#insertafterString?

Returns Used with C(state=present) and C(env). If specified, the environment variable will be inserted after the declaration of specified environment variable.

Returns:

  • (String, nil)

    Used with C(state=present) and C(env). If specified, the environment variable will be inserted after the declaration of specified environment variable.



73
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 73

attribute :insertafter

#insertbeforeObject?

Returns Used with C(state=present) and C(env). If specified, the environment variable will be inserted before the declaration of specified environment variable.

Returns:

  • (Object, nil)

    Used with C(state=present) and C(env). If specified, the environment variable will be inserted before the declaration of specified environment variable.



77
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 77

attribute :insertbefore

#jobString?

Returns The command to execute or, if env is set, the value of environment variable. Required if state=present.

Returns:

  • (String, nil)

    The command to execute or, if env is set, the value of environment variable. Required if state=present.



21
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 21

attribute :job

#minuteString?

Returns Minute when the job should run ( 0-59, *, */2, etc ).

Returns:

  • (String, nil)

    Minute when the job should run ( 0-59, *, */2, etc )



37
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 37

attribute :minute

#monthString?

Returns Month of the year the job should run ( 1-12, *, */2, etc ).

Returns:

  • (String, nil)

    Month of the year the job should run ( 1-12, *, */2, etc )



49
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 49

attribute :month

#nameString?

Returns Description of a crontab entry or, if env is set, the name of environment variable. Required if state=absent.

Returns:

  • (String, nil)

    Description of a crontab entry or, if env is set, the name of environment variable. Required if state=absent



13
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 13

attribute :name

#reboot:yes, ...

Returns If the job should be run at reboot. This option is deprecated. Users should use special_time.

Returns:

  • (:yes, :no, nil)

    If the job should be run at reboot. This option is deprecated. Users should use special_time.



57
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 57

attribute :reboot

#special_time:reboot, ...

Returns Special time specification nickname.

Returns:

  • (:reboot, :yearly, :annually, :monthly, :weekly, :daily, :hourly, nil)

    Special time specification nickname.



61
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 61

attribute :special_time

#state:present, ...

Returns Whether to ensure the job or environment variable is present or absent.

Returns:

  • (:present, :absent, nil)

    Whether to ensure the job or environment variable is present or absent.



25
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 25

attribute :state

#userString?

Returns The specific user whose crontab should be modified.

Returns:

  • (String, nil)

    The specific user whose crontab should be modified.



17
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 17

attribute :user

#weekdayString?

Returns Day of the week that the job should run ( 0-6 for Sunday-Saturday, *, etc ).

Returns:

  • (String, nil)

    Day of the week that the job should run ( 0-6 for Sunday-Saturday, *, etc )



53
# File 'lib/ansible/ruby/modules/generated/core/system/cron.rb', line 53

attribute :weekday