Puppet Class: keepalived

Defined in:
modules/keepalived/manifests/init.pp

Overview

Parameters:

  • peers (Array[Stdlib::Fqdn])
  • priority (Integer)
  • virtual_router_id (Integer)
  • vip (Stdlib::IP::Address)
  • auth_pass (String)
  • default_state (String)
  • interface (String)


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
# File 'modules/keepalived/manifests/init.pp', line 21

class keepalived(
    Array[Stdlib::Fqdn] $peers,
    Integer             $priority,
    Integer             $virtual_router_id,
    Stdlib::IP::Address $vip,
    String              $auth_pass,
    String              $default_state,
    String              $interface,
) {

    package { 'keepalived':
        ensure => present,
    }

    file { '/etc/keepalived/keepalived.conf':
        ensure    => present,
        mode      => '0444',
        owner     => 'root',
        group     => 'root',
        content   => template('keepalived/keepalived.conf.erb'),
        show_diff => false,
        require   => Package['keepalived'],
        notify    => Exec['restart-keepalived'],
    }

    exec { 'restart-keepalived':
        command     => '/bin/systemctl restart keepalived',
        refreshonly => true,
    }
}