1. 04 Oct, 2021 7 commits
    • Thomas Bellman's avatar
      Improve documentation of systemd::daemon_reload. · a466810b
      Thomas Bellman authored
      Mention that systemd::unit and systemd::unit_options automatically
      includes and notifies systemd::daemon_reload, so users don't have to
      do that themselves.
      a466810b
    • Thomas Bellman's avatar
      Better error messages from unitfile.erb template. · 3bd974d3
      Thomas Bellman authored
      Have the error messages that unitfile.erb can raise include reference
      to the resource (type and title) causing the error, so users can find
      where they made the error.
      3bd974d3
    • Thomas Bellman's avatar
      unit_options: Don't require options when ensure absent. · df8b5e43
      Thomas Bellman authored
      When setting ensure = absent to systemd::unit_options, it doesn't
      make sense for users to have to specify the options parameter.  But
      it was a mandatory parameter, so they had to.  Fix that.
      df8b5e43
    • Thomas Bellman's avatar
      Forbid minus-prefixed option names in systemd::unit. · ef6f9645
      Thomas Bellman authored
      In systemd::unit_options, you can prefix an option name with a minus
      sign (Unicode 002D "hyphen-minus") to "reset" a list option to the
      empty list, so the new values don't just append to the existing list
      of values.  That makes sense when overriding/supplementing options in
      earlier unit files, but systemd::unit installs the "main" unit file,
      the one that is read first, so list options *always* have the empty
      list as their value when the file is read.
      
      We here modify the unitfile.erb template file to see if it is called
      from systemd::unit or systemd::unit_options, and if the former, it
      raises an error if it encounters an option name starting with a minus
      sign.  And of course also remove the paragraph describing that beha-
      viour in the 'options' parameter documentation.
      ef6f9645
    • Thomas Bellman's avatar
      New definition for managing systemd unit files. · a6807aed
      Thomas Bellman authored
      This adds a new definition, systemd::unit, for managing unit files
      in /etc/systemd/system.  The content of the unit file can be given
      as a hash of hashes (like in the systemd::unit_options definition),
      as a string, or as a path or puppet: URL to a file to copy.
      
      Since we use the same ERB template file for formatting the hash of
      hashes into an ini-style file in both systemd::unit_options and
      systemd::unit, we have renamed the template file to "unitfile.erb",
      to be more neutral.  The comment at the end mentioning from where
      the file is managed, now takes the Puppet definition as a parameter,
      set by the definition.
      a6807aed
    • Thomas Bellman's avatar
      Move directory paths to separate class. · 955de344
      Thomas Bellman authored
      This adds the semi-internal class 'systemd::vars' containing various
      paths and other constants for use in the rest of the module, so we
      won't need to repeat ourselves.  Currently only contains a single
      variable, $etcdir, pointing to /etc/systemd/system.
      955de344
    • Thomas Bellman's avatar
      Fix error handling bug in systemd::unit_options. · 2fd869a5
      Thomas Bellman authored
      The default case in the case switch for the $ensure parameter was
      incorrectly using the *string* "default" instead of the keyword
      ``default''.  This meant that you did not get an error message if
      you specified an illegal value for that parameter (unless it happened
      to be exactly the string "default").
      2fd869a5
  2. 27 Mar, 2021 5 commits