Puppet Class: vnc::client::novnc::service

Inherits:
vnc::client::novnc
Defined in:
manifests/client/novnc/service.pp

Summary

manage the websockify service

Overview

Parameters:

  • manage_service (Any) (defaults to: $vnc::client::novnc::manage_service)
  • websockify_command (Any) (defaults to: $vnc::client::novnc::websockify_command)
  • websockify_service_user (Any) (defaults to: $vnc::client::novnc::websockify_service_user)
  • websockify_service_group (Any) (defaults to: $vnc::client::novnc::websockify_service_group)
  • websockify_service_dynamicuser (Any) (defaults to: $vnc::client::novnc::websockify_service_dynamicuser)
  • websockify_service_name (Any) (defaults to: $vnc::client::novnc::websockify_service_name)
  • websockify_service_ensure (Any) (defaults to: $vnc::client::novnc::websockify_service_ensure)
  • websockify_service_enable (Any) (defaults to: $vnc::client::novnc::websockify_service_enable)
  • websockify_auth_plugin (Any) (defaults to: $vnc::client::novnc::websockify_auth_plugin)
  • websockify_auth_source (Any) (defaults to: $vnc::client::novnc::websockify_auth_source)
  • websockify_token_plugin (Any) (defaults to: $vnc::client::novnc::websockify_token_plugin)
  • websockify_token_source (Any) (defaults to: $vnc::client::novnc::websockify_token_source)
  • websockify_port (Any) (defaults to: $vnc::client::novnc::websockify_port)
  • websockify_webroot (Any) (defaults to: $vnc::client::novnc::websockify_webroot)
  • websockify_prefer_ipv6 (Any) (defaults to: $vnc::client::novnc::websockify_prefer_ipv6)
  • websockify_use_ssl (Any) (defaults to: $vnc::client::novnc::websockify_use_ssl)
  • websockify_use_ssl_only (Any) (defaults to: $vnc::client::novnc::websockify_use_ssl_only)
  • websockify_ssl_ca (Any) (defaults to: $vnc::client::novnc::websockify_ssl_ca)
  • websockify_ssl_cert (Any) (defaults to: $vnc::client::novnc::websockify_ssl_cert)
  • websockify_ssl_key (Any) (defaults to: $vnc::client::novnc::websockify_ssl_key)


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
# File 'manifests/client/novnc/service.pp', line 5

class vnc::client::novnc::service (
  # lint:ignore:parameter_types
  $manage_service = $vnc::client::novnc::manage_service,
  $websockify_command = $vnc::client::novnc::websockify_command,
  $websockify_service_user = $vnc::client::novnc::websockify_service_user,
  $websockify_service_group = $vnc::client::novnc::websockify_service_group,
  $websockify_service_dynamicuser = $vnc::client::novnc::websockify_service_dynamicuser,
  $websockify_service_name = $vnc::client::novnc::websockify_service_name,
  $websockify_service_ensure = $vnc::client::novnc::websockify_service_ensure,
  $websockify_service_enable = $vnc::client::novnc::websockify_service_enable,
  $websockify_auth_plugin = $vnc::client::novnc::websockify_auth_plugin,
  $websockify_auth_source = $vnc::client::novnc::websockify_auth_source,
  $websockify_token_plugin = $vnc::client::novnc::websockify_token_plugin,
  $websockify_token_source = $vnc::client::novnc::websockify_token_source,
  $websockify_port = $vnc::client::novnc::websockify_port,
  $websockify_webroot = $vnc::client::novnc::websockify_webroot,
  $websockify_prefer_ipv6 = $vnc::client::novnc::websockify_prefer_ipv6,
  $websockify_use_ssl = $vnc::client::novnc::websockify_use_ssl,
  $websockify_use_ssl_only = $vnc::client::novnc::websockify_use_ssl_only,
  $websockify_ssl_ca = $vnc::client::novnc::websockify_ssl_ca,
  $websockify_ssl_cert = $vnc::client::novnc::websockify_ssl_cert,
  $websockify_ssl_key = $vnc::client::novnc::websockify_ssl_key,
  # lint:endignore
) inherits vnc::client::novnc {
  assert_private()

  if $websockify_service_ensure == 'running' {
    $active = true
  } else {
    $active = false
  }

  $template_params = {
    'websockify_command'             => $websockify_command,
    'websockify_service_user'        => $websockify_service_user,
    'websockify_service_group'       => $websockify_service_group,
    'websockify_service_dynamicuser' => $websockify_service_dynamicuser,
    'websockify_auth_plugin'         => $websockify_auth_plugin,
    'websockify_auth_source'         => $websockify_auth_source,
    'websockify_token_plugin'        => $websockify_token_plugin,
    'websockify_token_source'        => $websockify_token_source,
    'websockify_port'                => $websockify_port,
    'websockify_webroot'             => $websockify_webroot,
    'websockify_prefer_ipv6'         => $websockify_prefer_ipv6,
    'websockify_use_ssl'             => $websockify_use_ssl,
    'websockify_use_ssl_only'        => $websockify_use_ssl_only,
    'websockify_ssl_ca'              => $websockify_ssl_ca,
    'websockify_ssl_cert'            => $websockify_ssl_cert,
    'websockify_ssl_key'             => $websockify_ssl_key,
  }

  if $manage_service {
    systemd::unit_file { $websockify_service_name:
      ensure  => 'present',
      enable  => $websockify_service_enable,
      active  => $active,
      content => epp('vnc/usr/lib/systemd/system/websockify.service.epp', $template_params),
    }

    if $websockify_use_ssl {
      Systemd::Unit_file[$websockify_service_name] {
        subscribe => File[$websockify_ssl_cert, $websockify_ssl_key, $websockify_ssl_ca],
      }
    }
  }
}