Puppet Class: dconf

Defined in:
manifests/init.pp

Overview

Manage ‘dconf’ and associated entries

Parameters:

  • user_profile (Dconf::DBSettings)

    The contents of the default user profile that will be added

    @see data/common.yaml

  • user_settings (Optional[Dconf::SettingsHash]) (defaults to: undef)

    Custom user settings that can be provided via Hiera globally

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

    The version of ‘dconf` to install

    • Accepts any valid ‘ensure` parameter value for the `package` resource

  • use_user_profile_defaults (Boolean) (defaults to: true)

    Add the default ‘user_profile` settings to the system

  • user_profile_defaults_name (String[1]) (defaults to: 'Defaults')

    The name that should be used for the custom ‘dconf::profile` in `user_profile`

  • user_profile_target (String[1]) (defaults to: 'user')

    The name of the profile that should be targeted for the defaults

  • use_user_settings_defaults (Boolean) (defaults to: $use_user_profile_defaults)

    Enable creation of custom ‘dconf::settings` based on the `user_settings` Hash

  • user_settings_defaults_name (String[1]) (defaults to: $user_profile_defaults_name)

    The name that should be used for the custom ‘dconf::settings’ as well as the target profile for those settings

  • tidy (Boolean) (defaults to: true)

    If set to true, any files in the profile directory that aren’t managed by puppet will be purged

  • authselect (Boolean) (defaults to: simplib::lookup('simp_options::authselect', { 'default_value' => false }))


37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'manifests/init.pp', line 37

class dconf (
  Dconf::DBSettings             $user_profile,
  Optional[Dconf::SettingsHash] $user_settings               = undef,
  Simplib::PackageEnsure        $package_ensure              = simplib::lookup('simp_options::package_ensure', { 'default_value' => 'installed' }),
  Boolean                       $use_user_profile_defaults   = true,
  String[1]                     $user_profile_defaults_name  = 'Defaults',
  String[1]                     $user_profile_target         = 'user',
  Boolean                       $use_user_settings_defaults  = $use_user_profile_defaults,
  String[1]                     $user_settings_defaults_name = $user_profile_defaults_name,
  Boolean                       $tidy                        = true,
  Boolean                       $authselect                  = simplib::lookup('simp_options::authselect', { 'default_value' => false }),
) {
  simplib::assert_metadata($module_name)

  include 'dconf::install'

  if $use_user_profile_defaults {
    dconf::profile { $user_profile_defaults_name:
      target  => $user_profile_target,
      entries => $user_profile,
    }
  }

  if $user_settings and $use_user_settings_defaults {
    dconf::settings { $user_settings_defaults_name:
      settings_hash => $user_settings,
      profile       => $user_settings_defaults_name,
    }
  }
  else {
    dconf::settings { $user_settings_defaults_name:
      ensure => 'absent',
    }
  }

  # If using authselect, the following files need to managed or there will be conflicts
  if $authselect {
    file { '/etc/dconf/db/distro.d/20-authselect': }
    file { '/etc/dconf/db/distro.d/locks/20-authselect': }
  }
}