Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New systemd::timer define type #138

Merged
merged 1 commit into from
Feb 5, 2020
Merged

New systemd::timer define type #138

merged 1 commit into from
Feb 5, 2020

Conversation

mmoll
Copy link

@mmoll mmoll commented Feb 4, 2020

The defined type allows easy creation of the timer and service
unit at the same time.

Examples of usage

systemd::timer{'runoften.timer':
  timer_source   => "puppet:///modules/${module_name}/runoften.timer",
  service_source => "puppet:///modules/${module_name}/runoften.service",
}

or a trivial daily run as:

systemd::timer{'daily.timer':
  timer_content  => "[Timer]\nOnCalendar=daily\nRandomizedDelaySec=1d\n",
  service_content => "[Service]\nType=oneshot\nExecStart=/usr/bin/touch /tmp/file",
}

If neither service_content or service_source are specified then no
service unit will be created.

The service unit name can also be specified.

systemd::timer{'daily.timer':
  timer_content  => "[Timer]\nOnCalendar=daily\nRandomizedDelaySec=1d\nUnit=touch-me-today.service",
  service_unit   => 'touch-me-today.service',
  service_content => "[Service]\nType=oneshot\nExecStart=/usr/bin/touch /tmp/file",
}

Fixes: 118

The defined type allows easy creation of the timer and service
unit at the same time.

Examples of usage

```puppet
systemd::timer{'runoften.timer':
  timer_source   => "puppet:///modules/${module_name}/runoften.timer",
  service_source => "puppet:///modules/${module_name}/runoften.service",
}
```
or a trivial daily run as:

```puppet
systemd::timer{'daily.timer':
  timer_content  => "[Timer]\nOnCalendar=daily\nRandomizedDelaySec=1d\n",
  service_content => "[Service]\nType=oneshot\nExecStart=/usr/bin/touch /tmp/file",
}
```

If neither `service_content` or `service_source` are specified then no
service unit will be created.

The service unit name can also be specified.

```puppet
systemd::timer{'daily.timer':
  timer_content  => "[Timer]\nOnCalendar=daily\nRandomizedDelaySec=1d\nUnit=touch-me-today.service",
  service_unit   => 'touch-me-today.service',
  service_content => "[Service]\nType=oneshot\nExecStart=/usr/bin/touch /tmp/file",
}
```

Fixes: 118
@mmoll
Copy link
Author

mmoll commented Feb 4, 2020

rebased and fixed version of GH-119.

@bastelfreak bastelfreak added the enhancement New feature or request label Feb 4, 2020
@bastelfreak bastelfreak merged commit bb988ab into voxpupuli:master Feb 5, 2020
@raphink raphink mentioned this pull request Jul 15, 2020
op-ct pushed a commit to op-ct/puppet-systemd that referenced this pull request Jun 17, 2022
…etagent

add requirement expression in metadata of task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants