Puppet Class: vnc::server

Summary

Install and configure the tigervnc server

Overview

This class will install and configure the tigervnc server, setup defaults, and manage the services.

The default state is running/enabled, not user managed

Parameters:

  • manage_packages (Boolean)

    Should this class manage the packages

  • packages (Array)

    List of packages to install

  • packages_ensure (String)

    Ensure state of the vnc server packages

  • manage_config (Boolean)

    Should this class manage the config

  • config_defaults_file (Stdlib::Absolutepath)

    Your /etc/tigervnc/vncserver-config-defaults

  • config_defaults (Hash[String, Variant[String, Undef]])

    Settings to put in /etc/tigervnc/vncserver-config-defaults

  • config_mandatory_file (Stdlib::Absolutepath)

    Your /etc/tigervnc/vncserver-config-mandatory

  • config_mandatory (Hash[String, Variant[String, Undef]])

    Settings to put in /etc/tigervnc/vncserver-config-mandatory

  • vncserver_users_file (Stdlib::Absolutepath)

    Your /etc/tigervnc/vncserver.users

  • polkit_file (Stdlib::Absolutepath)

    Your /etc/polkit-1/rules.d/25-puppet-vncserver.rules

  • polkit_file_mode (String)

    Your /etc/polkit-1/rules.d/25-puppet-vncserver.rules permissions It should pretty much always be 644

  • manage_services (Boolean)

    Should this class manage the vncserver services

  • user_can_manage (Boolean)

    Should users be able to manage the systemd service by default

  • extra_users_can_manage (Array[String])

    Who else should be able to manage the VNC sessions

  • vnc_home_conf (Stdlib::Absolutepath)

    Where does VNC keep its config (/.vnc) NOTE: MUST start with ‘/` NOTE: MUST NOT end with `/`

  • seed_home_vnc (Boolean)

    Should this class generate a per-user ~/.vnc if it doesn’t exist?

  • systemd_template_startswith (String)

    What does the vnc template service start with, including the ‘@’

  • systemd_template_endswith (String)

    What does the vnc template service end with (not including the ‘.’)

  • vnc_servers (Hash[String, Hash[Enum['displaynumber', 'user_can_manage', 'seed_home_vnc', 'comment', 'ensure', 'enable', 'extra_users_can_manage'], Variant[Array[String], String, Integer, Boolean, Undef]]])

    A hash of VNC servers to setup Format: userA:

    comment: Sometimes you've gotta write it down
    displaynumber: 1
    ensure: running
    enable: true
    user_can_manage: true
    seed_home_vnc: false
    

    userB:

    displaynumber: 2
    ensure: stopped
    enable: false
    user_can_manage: false
    


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
# File 'manifests/server.pp', line 62

class vnc::server (
  Boolean $manage_packages,
  Array $packages,
  String $packages_ensure,
  Boolean $manage_config,
  Stdlib::Absolutepath $config_defaults_file,
  Hash[String, Variant[String, Undef]] $config_defaults,
  Stdlib::Absolutepath $config_mandatory_file,
  Hash[String, Variant[String, Undef]] $config_mandatory,
  Stdlib::Absolutepath $vncserver_users_file,
  Stdlib::Absolutepath $polkit_file,
  Stdlib::Absolutepath $vnc_home_conf,
  String $polkit_file_mode,
  Boolean $manage_services,
  Boolean $user_can_manage,
  Boolean $seed_home_vnc,
  Array[String] $extra_users_can_manage,
  String $systemd_template_startswith,
  String $systemd_template_endswith,

  # lint:ignore:140chars
  Hash[String, Hash[Enum['displaynumber', 'user_can_manage', 'seed_home_vnc', 'comment', 'ensure', 'enable', 'extra_users_can_manage'], Variant[Array[String], String, Integer, Boolean, Undef]]] $vnc_servers,
  # lint:endignore
) {
  contain 'vnc::server::install'
  contain 'vnc::server::config'
  contain 'vnc::server::service'

  Class['vnc::server::install'] -> Class['vnc::server::config'] ~> Class['vnc::server::service']
  Class['vnc::server::install'] ~> Class['vnc::server::service']
}