Skip to content

Cache cannot be set to no in /etc/systemd/resolved.conf #113

Closed
@robertvargason

Description

As far as I understand one should be able to set the value of Cache to 'yes' or 'no' in /etc/systemd/resolved.conf via systemd::resolved.

But in systemd::resolved the variable named $cache is a Boolean and if it is set to false, the value does not get rendered to /etc/systemd/resolved.conf:

$_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 only setting it to true will render it to the file with Cache=yes (which under Ubuntu is the default anyway) and one can never set Cache=no. Because using only a Boolean will mean you have to render it out everywhere (even on installations where you are not concerned with this value and would like not to have this file modified), I would hope for a different solution (e.g. not using a Boolean or two variables).

Thank you so much!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions