summaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: 5251a817209d1392f6d15de89b9f39dc1f50d78d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# @param filename
#   File containing the lightdm config
# @param seat_fragment_min
#   Minimum value for range of seat configuration.
#   This defines the interval in which seats can be allocated. You
#   might need to increase the interval if you have MANY seats.
#   The XDMCP and VLC server are configured to always be placed just
#   after all seats.
# @param seat_fragment_max
#   Maximum value for range of seat configuration. See
#   seat_fragment_min
# --------------------------------------------------
# @param start_default_seat
#   True to always start one seat if none are defined in the configuration
# @param greeter_user
#   User to run greeter as
# @param minimum_display_number
#   Minimum display number to use for X servers
# @param minimum_vt
#   First VT to run displays on
# @param lock_memory
#   True to prevent memory from being paged to disk
# @param user_authority_in_system_dir
#   True if session authority should be in the system location
# @param guest_account_script
#   Script to be run to setup guest account
# @param logind_check_graphical
#   True to on start seats that are marked as graphical by logind
# @param log_directory
#   Directory to log information to
# @param run_directory
#   Directory to put running state in
# @param cache_directory
#   Directory to cache to
# @param sessions_directory
#   Directory to find sessions
# @param remote_sessions_directory
#   Directory to find remote sessions
# @param greeters_directory
#   Directory to find greeters
# @param backup_logs
#   True to move add a .old suffix to old log files when opening new ones
# @param dbus_service
#   True if LightDM provides a D-Bus service to control it
class lightdm::config (
  Optional[Boolean] $start_default_seat = undef,
  Optional[String] $greeter_user = undef,
  Optional[Integer] $minimum_display_number = undef,
  Optional[Integer] $minimum_vt = undef,
  Optional[Boolean] $lock_memory = undef,
  Optional[Boolean] $user_authority_in_system_dir = undef,
  Optional[String] $guest_account_script = undef,
  Optional[Boolean] $logind_check_graphical = undef,
  Optional[Stdlib::Absolutepath] $log_directory = undef,
  Optional[Stdlib::Absolutepath] $run_directory = undef,
  Optional[Stdlib::Absolutepath] $cache_directory = undef,
  Optional[Variant[Stdlib::Absolutepath, Array[Stdlib::Absolutepath]]] $sessions_directory = undef,
  Optional[Stdlib::Absolutepath] $remote_sessions_directory = undef,
  Optional[Variant[String, Array[String]]] $greeters_directory = undef,
  Optional[Boolean] $backup_logs = undef,
  Optional[Boolean] $dbus_service = undef,

  Integer[2] $seat_fragment_min = 20,
  Integer $seat_fragment_max = 40,
  String $filename = '/etc/lightdm/lightdm.conf',
) {
  concat { $filename:
    order => 'numeric',
  }

  $lightdm_conf = {
    'start-default-seat'           => $start_default_seat,
    'greeter-user'                 => $greeter_user,
    'minimum-display-number'       => $minimum_display_number,
    'minimum-vt'                   => $minimum_vt,
    'lock-memory'                  => $lock_memory,
    'user-authority-in-system-dir' => $user_authority_in_system_dir,
    'guest-account-script'         => $guest_account_script,
    'logind-check-graphical'       => $logind_check_graphical,
    'log-directory'                => $log_directory,
    'run-directory'                => $run_directory,
    'cache-directory'              => $cache_directory,
    'sessions-directory'           => $sessions_directory,
    'remote-sessions-directory'    => $remote_sessions_directory,
    'greeters-directory'           => $greeters_directory,
    'backup-logs'                  => $backup_logs,
    'dbus-service'                 => $dbus_service,
  }

  concat::fragment { 'lightdm - config - header':
    target  => $filename,
    content => "# File managed by Puppet\n",
    order   => 0,
  }

  concat::fragment { 'lightdm - config - main':
    target  => $filename,
    order   => 1,
    content => epp("${module_name}/ini.epp", {
        sections => { 'LightDM' => $lightdm_conf },
    }),
  }
}