Puppet Class: openstack::nova::common

Defined in:
modules/openstack/manifests/nova/common.pp

Overview

Parameters:

  • version (Any)
  • region (Any)
  • db_user (Any)
  • db_pass (Any)
  • db_host (Any)
  • db_name (Any)
  • db_name_api (Any)
  • openstack_controllers (Any)
  • keystone_api_fqdn (Any)
  • scheduler_filters (Any)
  • ldap_user_pass (Any)
  • rabbit_user (Any)
  • rabbit_pass (Any)
  • metadata_proxy_shared_secret (Any)
  • compute_workers (Any)
  • metadata_workers (Any)
  • metadata_listen_port (Stdlib::Port)
  • osapi_compute_listen_port (Stdlib::Port)
  • dhcp_domain (String)


1
2
3
4
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'modules/openstack/manifests/nova/common.pp', line 1

class openstack::nova::common(
    $version,
    $region,
    $db_user,
    $db_pass,
    $db_host,
    $db_name,
    $db_name_api,
    $openstack_controllers,
    $keystone_api_fqdn,
    $scheduler_filters,
    $ldap_user_pass,
    $rabbit_user,
    $rabbit_pass,
    $metadata_proxy_shared_secret,
    $compute_workers,
    $metadata_workers,
    Stdlib::Port $metadata_listen_port,
    Stdlib::Port $osapi_compute_listen_port,
    String       $dhcp_domain,
    ) {

    class { "openstack::nova::common::${version}::${::lsbdistcodename}": }

    # For some reason the Mitaka nova-common package installs
    #  a logrotate rule for nova/*.log and also a nova/nova-manage.log.
    #  This is redundant and makes log-rotate unhappy.
    # Not to mention, nova-manage.log is very low traffic and doesn't
    #  really need to be rotated anyway.
    file { '/etc/logrotate.d/nova-manage':
        ensure  => 'absent',
        require => Package['nova-common'],
    }

    file { '/etc/nova/policy.json':
        ensure => absent,
    }

    file { '/etc/nova/policy.yaml':
        source  => "puppet:///modules/openstack/${version}/nova/common/policy.yaml",
        mode    => '0644',
        owner   => 'root',
        group   => 'root',
        require => Package['nova-common'],
    }

    file {
        '/etc/nova/nova.conf':
            content   => template("openstack/${version}/nova/common/nova.conf.erb"),
            owner     => 'nova',
            group     => 'nogroup',
            mode      => '0440',
            show_diff => false,
            require   => Package['nova-common'];
        '/etc/nova/api-paste.ini':
            content => template("openstack/${version}/nova/common/api-paste.ini.erb"),
            owner   => 'nova',
            group   => 'nogroup',
            mode    => '0440',
            require => Package['nova-common'];
        '/etc/nova/vendor_data.json':
            content => template('openstack/nova/vendor_data.json.erb'),
            owner   => 'nova',
            group   => 'nogroup',
            mode    => '0444',
            require => Package['nova-common'];
    }

    # Overlay a tooz driver that has an encoding bug.  This bug is present
    #  in version of this package found in the rocky apt repo, 1.62.0-1~bpo9+1.
    #  It is likely fixed in any future version, so this should probably not be
    #  forwarded to S.
    #
    # Upstream bug: https://bugs.launchpad.net/python-tooz/+bug/1530888
    file { '/usr/lib/python3/dist-packages/tooz/drivers/memcached.py':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0644',
        require => Package['nova-common'],
        source  => 'puppet:///modules/openstack/rocky/toozpatch/tooz-memcached.py';
    }

    if os_version('debian >= buster') {
        # The Buster version of the Rocky packages creates the nova user
        #  with a weird high-number uid.  Try to head it off by creating here
        #  ahead of time.
        group { 'nova':
            ensure => 'present',
            name   => 'nova',
            system => true,
        }

        user { 'nova':
            ensure     => 'present',
            name       => 'nova',
            comment    => 'nova system user',
            gid        => 'nova',
            managehome => true,
            before     => Package['nova-common'],
            system     => true,
        }
    }


}