Puppet Class: openstack::nova::api::service::wallaby

Defined in:
modules/openstack/manifests/nova/api/service/wallaby.pp

Overview

Parameters:

  • api_bind_port (Stdlib::Port)
  • metadata_bind_port (Stdlib::Port)
  • compute_workers (Integer)


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
# File 'modules/openstack/manifests/nova/api/service/wallaby.pp', line 1

class openstack::nova::api::service::wallaby(
    Stdlib::Port $api_bind_port,
    Stdlib::Port $metadata_bind_port,
    Integer $compute_workers,
) {
    # simple enough to don't require per-debian release split
    require "openstack::serverpackages::wallaby::${::lsbdistcodename}"

    ensure_packages(['nova-api', 'patch'])

    file { '/etc/init.d/nova-api':
        content => template('openstack/wallaby/nova/api/nova-api'),
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        notify  => Service['nova-api'],
        require => Package['nova-api'];
    }

    # Hack in regex validation for instance names.
    #  Context can be found in T207538
    $file_to_patch = '/usr/lib/python3/dist-packages/nova/api/openstack/compute/servers.py'
    $patch_file = "${file_to_patch}.patch"
    file {$patch_file:
        source => 'puppet:///modules/openstack/wallaby/nova/hacks/servers.py.patch',
        owner  => 'root',
        group  => 'root',
        mode   => '0644',
    }
    exec { "apply ${patch_file}":
        command => "/usr/bin/patch --forward ${file_to_patch} ${patch_file}",
        unless  => "/usr/bin/patch --reverse --dry-run -f ${file_to_patch} ${patch_file}",
        require => [File[$patch_file], Package['nova-api']],
        notify  => Service['nova-api'],
    }

    file { '/etc/init.d/nova-api-metadata':
        content => template('openstack/wallaby/nova/api/nova-api-metadata'),
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        notify  => Service['nova-api-metadata'],
        require => Package['nova-api'];
    }
    file { '/etc/nova/nova-api-metadata-uwsgi.ini':
        content => template('openstack/wallaby/nova/api/nova-api-metadata-uwsgi.ini.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        notify  => Service['nova-api-metadata'],
        require => Package['nova-api'];
    }
    service { 'nova-api-metadata':
        ensure    => 'running',
        subscribe => [
                      File['/etc/nova/nova.conf'],
                      File['/etc/nova/policy.yaml'],
            ],
        require   => Package['nova-api'];
    }
    file { '/etc/nova/nova-api-uwsgi.ini':
        content => template('openstack/wallaby/nova/api/nova-api-uwsgi.ini.erb'),
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        notify  => Service['nova-api-metadata'],
        require => Package['nova-api'];
    }
}