Puppet Class: polkit

Defined in:
manifests/init.pp

Summary

Set up PolicyKit

Overview

Allows you to set up and manipulate PolicyKit objects

Parameters:

  • manage_polkit_user (Boolean) (defaults to: true)

    Enables managment of the ‘$polkit_user`

    • Enabled by default since newer versions of polkit require the ‘$polkit_user` to be in the group assigned to /proc to function properly

    @see ‘polkit::user`

  • package_ensure (Polkit::PackageEnsure) (defaults to: simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }))

    The ensure status of packages

  • warn_on_unsupported_os (Boolean) (defaults to: true)

    Warn if the module is trying to be used on an unsupported OS

    • The module will not fail on an unsupported OS but also will not perform any action

See Also:

Author:



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'manifests/init.pp', line 26

class polkit (
  Boolean               $manage_polkit_user     = true,
  Polkit::PackageEnsure $package_ensure         = simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }),
  Boolean               $warn_on_unsupported_os = true
){
  if simplib::module_metadata::os_supported( load_module_metadata($module_name), { 'release_match' => 'major' }) {
    include polkit::install
    include polkit::service

    Class['polkit::install'] ~> Class['polkit::service']

    if $manage_polkit_user {
      include polkit::user

      Class['polkit::install'] -> Class['polkit::user']
      Class['polkit::user'] ~> Class['polkit::service']
    }
  }
  elsif $warn_on_unsupported_os {
    warning("${facts['os']['name']} ${facts['os']['release']['full']} is not supported by ${module_name}. To silence this warning, set ${module_name}::warn_on_unsupported_os to 'false'")
  }
}