Puppet Class: profile::homer

Defined in:
modules/profile/manifests/homer.pp

Overview

Parameters:

  • private_git_peer (Stdlib::Host) (defaults to: lookup('profile::homer::private_git_peer'))
  • nb_ro_token (String) (defaults to: lookup('profile::netbox::tokens::read_only'))
  • nb_api (Stdlib::HTTPSUrl) (defaults to: lookup('profile::netbox::netbox_api'))
  • diff_timer_interval (String) (defaults to: lookup('profile::homer::diff_timer_interval'))


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
# File 'modules/profile/manifests/homer.pp', line 5

class profile::homer (
    Stdlib::Host $private_git_peer = lookup('profile::homer::private_git_peer'),
    String $nb_ro_token = lookup('profile::netbox::tokens::read_only'),
    Stdlib::HTTPSUrl $nb_api = lookup('profile::netbox::netbox_api'),
    String $diff_timer_interval = lookup('profile::homer::diff_timer_interval'),
){

    require_package('virtualenv', 'make')

    # Install the app itself
    scap::target { 'homer/deploy':
        deploy_user => 'deploy-homer',
    }

    keyholder::agent { 'homer':
        trusted_groups => ['ops', 'root'],
    }

    class { 'homer':
        private_git_peer => $private_git_peer,
        nb_token         => $nb_ro_token,
        nb_api           => $nb_api,
    }

    file { '/usr/local/sbin/check-homer-diff':
        ensure  => present,
        owner   => 'root',
        group   => 'root',
        mode    => '0544',
        source  => 'puppet:///modules/profile/homer/check_homer_diff.sh',
        require => Class['homer'],
    }

    systemd::timer::job { 'check-homer-diff':
        description => 'Check if any network device has a live config that differs from the code-defined one',
        command     => '/usr/local/sbin/check-homer-diff',
        interval    => {
            'start'    => 'OnCalendar',
            'interval' => $diff_timer_interval,
        },
        user        => 'root',  # Needed to access the keyholder SSH key
        require     => File['/usr/local/sbin/check-homer-diff'],
    }
}