Comments (11)
I can confirm this bug, as the code reads:
$_cache = $cache ? {
true => 'yes',
false => 'no',
}
if $cache {
ini_setting{ 'cache':
ensure => 'present',
value => $_cache,
setting => 'Cache',
section => 'Resolve',
path => '/etc/systemd/resolved.conf',
notify => Service['systemd-resolved'],
}
}
so $_cache
gets set to the right value, but never applied.
from puppet-systemd.
Hi,
just ran into an issue as well, I want to use the parameter no-negative in section cache.
I had to change manifest to enable caching with
"no-negative"
so in
resolved.pp
Boolean $cache = $systemd::cache,
has been changed to
Optional[Variant[Array[String],String]] $cache = $systemd::cache,
and in section
$_cache = $cache ? {
true => 'yes',
false => 'no',
'no-negative' => 'no-negative',
}
no-negative was added
Could u update or built in using the Feature no-negative in a future release?
Thx in advance
from puppet-systemd.
@Schamane187 can you provide a patch for this?
from puppet-systemd.
Hi,
was moving away for the moment from systemd for that task, cause CentOS 7 Systemd is to outdated for those features. But with CentOS 8 I will be back to this.
A Patch for 2 lines? but ok, here we go
diff -upr puppet-systemd-master_org/manifests/resolved.pp puppet-systemd-master/manifests/resolved.pp
--- puppet-systemd-master_org/manifests/resolved.pp 2019-07-15 11:48:00.000000000 +0200
+++ puppet-systemd-master/manifests/resolved.pp 2019-09-23 09:55:40.000000000 +0200
@@ -53,8 +53,8 @@ class systemd::resolved (
Optional[Variant[Boolean,Enum['resolve']]] $multicast_dns = $systemd::multicast_dns,
Optional[Variant[Boolean,Enum['allow-downgrade']]] $dnssec = $systemd::dnssec,
Optional[Variant[Boolean,Enum['opportunistic', 'no']]] $dnsovertls = $systemd::dnsovertls,
- Boolean $cache = $systemd::cache,
Optional[Variant[Boolean,Enum['udp', 'tcp']]] $dns_stub_listener = $systemd::dns_stub_listener,
+ Optional[Variant[Array[String],String]] $cache = $systemd::cache,
Boolean $use_stub_resolver = $systemd::use_stub_resolver,
){
@@ -200,6 +200,7 @@ class systemd::resolved (
$_cache = $cache ? {
true => 'yes',
false => 'no',
+ 'no-negative' => 'no-negative',
}
if $cache {
Cheers
from puppet-systemd.
this pull request solves the issue:
from puppet-systemd.
PR got merged
from puppet-systemd.
This issue should not be closed as the original issue is still not resolved. One cannot set Cache=no
from puppet-systemd.
@robertvargason: you are right. there was an "if $cache" block, which prevent setting this to false.
i created a new merge request for this.
from puppet-systemd.
@schlitzered: thanks for that. the commited version is working for us.
if you want to be very clever with your implementation you might want to consider one of the two extra solutions:
a) to introduce a setting which leaves the setting Cache unrendered. So that Cache=yes, Cache=no, Cache=no-negative as well as no Cache setting at all (should be the module default) is possible. which leaves the option to not render the value and let the default value for Cache from systemd rule supreme (which is at the moment 'yes'). meaning also that the new puppet module version does not touch the /etc/systemd/resolved.conf (which is nice in my opinion).
b) use 'yes' as the option to not render the setting at all, because it is the systemd default. Meaning only 'no' or 'no-negative' is rendered. There is no benefit to explicit set Cache=yes, because it is the systemd default. This would (if you make 'yes' the module default value) also leave resolved.conf files untouched (except when module users already used to set 'yes' [which was unnecessary]).
thanks a lot
from puppet-systemd.
i leave this up to the original maintainer to decide.
but IMHO, I would set the default in the puppet module, to whatever the default is for the $OS_NAME and $OS_MAJOR. and always put this config into the on the system.
from puppet-systemd.
FIxed in #140
from puppet-systemd.
Related Issues (20)
- manage_unit service_entry Environment can't have multiple values HOT 3
- Running the example code for `systemd::manage_unit` from REFERENCE.md causes an error:
- Add possibility to setup limits for user sessions HOT 6
- IODeviceWeight, IOReadIOPSMax, .. do not work in systemd::manage_unit or systemd::dropin_file HOT 1
- Missing parameters under Service section HOT 2
- Provide possibility to disable service restart upon unit file change
- Add hiera-friendly option to manage dropins HOT 2
- Add `NetworkNamespacePath` to unit service HOT 4
- Allow specifying multiple Environment variable HOT 2
- Usage of `systemd::escape` in `systemd::timer_wrapper` creates weird names HOT 7
- [4.1.0] ignore active+enable when ensure is set to absent for systemd::timer HOT 1
- Issue with hiera since v 7.0.0 HOT 2
- systemd::user_service broken for puppet running in background HOT 3
- Deprecation of systemd::service_limits unexpectedly causes service restarts in some scenarios HOT 7
- Add support for systemd link files HOT 2
- Allow systemd unit specifiers in path values HOT 2
- Setting default_target fails due to deprecated shell_escape function HOT 2
- Inconsistent values for `notify_service` in replacement for `systemd::service_limits` HOT 1
- udev rules not reloaded after change
- Unit file path inconsistency HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-systemd.