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

[4.1.0] ignore active+enable when ensure is set to absent for systemd::timer #454

Open
mdc-webdb opened this issue Apr 19, 2024 · 1 comment

Comments

@mdc-webdb
Copy link

mdc-webdb commented Apr 19, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet:
  • Ruby:
  • Distribution:
  • Module version: 4.1.0

How to reproduce (e.g Puppet code you use)

systemd::timer { 'foo.timer':
    ensure          => $foo,
    timer_source    => "puppet:///modules/${module_name}/foo.timer",
    service_content => template("${module_name}/foo.service.erb"),
    active          => true,
    enable          => true,
    require         => File[$foo_command]
  }

What are you seeing

When $foo are absent then this error:

Evaluation Error: Error while evaluating a Function Call, Can't ensure the unit file is absent and activate/enable the service at the same time

What behaviour did you expect instead

simple that when $foo are absent, that the timner+server are removed and the other options are ignored.

@traylenator
Copy link
Contributor

traylenator commented Apr 27, 2024

This has been done deliberately:

#122

ambition is to stop the service before the unit file is removed so forcing you to specify stop on unit removal makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants