Puppet Class: consul_template::params

Inherited by:
consul_template
Defined in:
manifests/params.pp

Overview

Class consul_template::params

This class is meant to be called from consul_template. It sets variables according to platform.



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

class consul_template::params {
  $os = downcase($facts['kernel'])

  case $facts['architecture'] {
    'x86_64', 'amd64': {
      $arch = 'amd64'
    }

    'i386': {
      $arch = '386'
    }

    'aarch64': {
      $arch = 'arm64'
    }

    default:           {
      fail("Unsupported kernel architecture: ${facts['architecture']}")
    }
  }

  $init_style = $facts['os']['name'] ? {
    'Ubuntu' => $facts['os']['release']['major'] ? {
      '14.04' => 'upstart',
      default => 'systemd'
    },

    /CentOS|RedHat|Rocky|AlmaLinux/ => $facts['os']['release']['major'] ? {
      '6' => 'sysv',
      default   => 'systemd',
    },
    'Fedora'        => $facts['os']['release']['major'] ? {
      /(12|13|14)/ => 'sysv',
      default      => 'systemd',
    },
    'Debian'        =>  $facts['os']['release']['major'] ? {
      '7' => 'debian',
      default     => 'systemd'
    },

    default => 'sysv'
  }
}