Skip to content

Latest commit

 

History

History
201 lines (119 loc) · 5.48 KB

REFERENCE.md

File metadata and controls

201 lines (119 loc) · 5.48 KB

Reference

Table of Contents

Defined types

  • systemd_cron: systemd_cron Create systemd timer/service to replace cron jobs You either need to define on_calendar or on_boot_sec

Defined types

systemd_cron

systemd_cron Create systemd timer/service to replace cron jobs You either need to define on_calendar or on_boot_sec

Examples

Usage
systemd_cron { 'date':
  on_calendar         => '*:0/10',
  command             => '/bin/date',
  service_description => 'Print date',
  timer_description   => 'Run date.service every 10 minutes',
}

Parameters

The following parameters are available in the systemd_cron defined type:

on_calendar

Data type: Optional[String]

systemd timer OnCalendar= definition when to run the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.time.html

Default value: undef

on_boot_sec

Data type: Optional[Variant[Integer,String]]

systemd timer OnBootSec= definition

Default value: undef

on_unitactive_sec

Data type: Optional[Variant[Integer,String]]

systemd timer OnUnitActiveSec= definition

Default value: undef

command

Data type: Optional[String]

command string for ExecStart= defintion of the service to run as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html

Default value: undef

service_description

Data type: Optional[String]

string for Description= defintion of the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html

Default value: undef

ensure

Data type: Variant[Boolean,Enum['present','absent']]

removes the instance if set to false or absent

Default value: true

timer_description

Data type: String

optional string for Description= defintion of the service as defined in https://www.freedesktop.org/software/systemd/man/systemd.timer.html

Default value: "timer for ${service_description}"

type

Data type: String

type of service as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html

Default value: 'oneshot'

user

Data type: String

username to run command User= as defined in https://www.freedesktop.org/software/systemd/man/systemd.service.html

Default value: 'root'

additional_timer_params

Data type: Optional[Array]

Deprecated use timer_overrides instead can not be used in combination with timer_overrides

array with lines to append to [Timer] section

example: 'additional_timer_params' => [ 'RandomizedDelaySec=10' ]

Default value: undef

additional_service_params

Data type: Optional[Array]

Deprecated use service_overrides instead can not be used in combination with service_overrides

array with lines to append to [Service] section

example: 'additional_service_params' => [ 'User=bob' ]

Default value: undef

service_overrides

Data type: Systemd::Unit::Service

override for the[Service] section of the service can not be used in combination with additional_service_params

example: 'service_overrides' => { 'Wants' => 'network-online.target' }

Default value: {}

timer_overrides

Data type: Systemd::Unit::Timer

override for the[Timer] section of the timer can not be used in combination with additional_timer_params

example: 'timer_overrides' => { 'OnBootSec' => '10' }

Default value: {}

service_unit_overrides

Data type: Systemd::Unit::Unit

override for the[Unit] section of the service can not be used in combination with additional_service_params

example: 'service_unit_overrides' => { 'Wants' => 'network-online.target' }

Default value: {}

timer_unit_overrides

Data type: Systemd::Unit::Unit

override for the [Unit] section of the timer can not be used in combination with additional_timer_params

example: 'timer_unit_overrides' => { 'Documentation' => 'Very special timer' }

Default value: {}