Puppet Class: openstack::nova::fullstack::service

Defined in:
modules/openstack/manifests/nova/fullstack/service.pp

Overview

Parameters:

  • active (Boolean)
  • password (String[1])
  • region (String[1])
  • puppetmaster (String[1])
  • bastion_ip (Stdlib::IP::Address)
  • interval (Integer[1]) (defaults to: 300)
  • max_pool (Integer[1]) (defaults to: 11)
  • creation_timeout (Integer[1]) (defaults to: 900)
  • ssh_timeout (Integer[1]) (defaults to: 900)
  • puppet_timeout (Integer[1]) (defaults to: 900)
  • keyfile (Stdlib::Unixpath) (defaults to: '/var/lib/osstackcanary/osstackcanary_id')
  • network (String) (defaults to: '')
  • deployment (String) (defaults to: '')
  • resolvers (Array[String]) (defaults to: [])


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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'modules/openstack/manifests/nova/fullstack/service.pp', line 7

class openstack::nova::fullstack::service(
    Boolean $active,
    String[1] $password,
    String[1] $region,
    String[1] $puppetmaster,
    Stdlib::IP::Address $bastion_ip,
    Integer[1] $interval = 300,
    Integer[1] $max_pool = 11,
    Integer[1] $creation_timeout = 900,
    Integer[1] $ssh_timeout = 900,
    Integer[1] $puppet_timeout = 900,
    Stdlib::Unixpath $keyfile = '/var/lib/osstackcanary/osstackcanary_id',
    String $network = '',
    String $deployment = '',
    Array[String] $resolvers = [],
    ) {

    group { 'osstackcanary':
        ensure => 'present',
        name   => 'osstackcanary',
    }

    user { 'osstackcanary':
        ensure     => 'present',
        gid        => 'osstackcanary',
        shell      => '/bin/false',
        home       => '/var/lib/osstackcanary',
        managehome => true,
        system     => true,
        require    => Group['osstackcanary'],
    }

    file { '/usr/local/sbin/nova-fullstack':
        ensure => 'present',
        mode   => '0755',
        owner  => 'osstackcanary',
        group  => 'osstackcanary',
        source => 'puppet:///modules/openstack/nova/fullstack/nova_fullstack_test.py',
    }

    # Cleanup outfile only on acvive=false, since on active=true the file gets created by the nova-fullstack service.
    if !$active {
      file {'/var/lib/prometheus/node.d/novafullstack.prom':
          ensure => absent
      }
    }

    file { $keyfile:
        ensure    => 'present',
        mode      => '0600',
        owner     => 'osstackcanary',
        group     => 'osstackcanary',
        content   => secret('nova/osstackcanary'),
        show_diff => false,
    }

    $ensure = $active ? {
        true    => 'present',
        default => 'absent',
    }

    file { '/usr/local/bin/nova-fullstack':
        ensure  => 'present',
        mode    => '0544',
        owner   => 'root',
        group   => 'root',
        content => template('openstack/initscripts/nova-fullstack.erb'),
    }

    systemd::service { 'nova-fullstack':
        ensure    => $ensure,
        content   => systemd_template('nova-fullstack'),
        restart   => true,
        require   => [
            File['/usr/local/bin/nova-fullstack'],
            File['/usr/local/sbin/nova-fullstack'],
        ],
        subscribe => [
            File['/usr/local/bin/nova-fullstack'],
            File['/usr/local/sbin/nova-fullstack'],
        ],
    }
}