Puppet Class: openstack::neutron::service::rocky

Defined in:
modules/openstack/manifests/neutron/service/rocky.pp

Overview

Parameters:

  • bind_port (Stdlib::Port)
  • active (Boolean)


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

class openstack::neutron::service::rocky(
    Stdlib::Port $bind_port,
    Boolean $active,
    ) {
    # simple enough to don't require per-debian release split
    require "openstack::serverpackages::rocky::${::lsbdistcodename}"

    service {'neutron-api':
        ensure    => $active,
        require   => Package['neutron-server', 'neutron-api'],
        subscribe => [
                      File['/etc/neutron/neutron.conf'],
                      File['/etc/neutron/policy.yaml'],
                      File['/etc/neutron/plugins/ml2/ml2_conf.ini'],
            ],
    }

    package { 'neutron-server':
        ensure => 'present',
    }
    package { 'neutron-api':
        ensure => 'present',
    }

    # The rocky neutron package installs a 'neutron-api' init script
    #  rather than 'neutron-server'.  We need to override it to set the
    #  port anyway, so just remove the packaged service script and
    #  import our own instead.
    #
    # Our 'neutron-server' script is just the packaged neutron-api script
    #  renamed and with the port changed.
    file {
        '/etc/init.d/neutron-api':
            content => template('openstack/rocky/neutron/neutron-api'),
            owner   => 'root',
            group   => 'root',
            mode    => '0755',
            notify  => Service['neutron-api'],
            require => Package['neutron-server', 'neutron-api'];
        '/etc/init.d/neutron-server':
            ensure => absent;
        '/etc/neutron/neutron-api-uwsgi.ini':
            ensure  => 'present',
            owner   => 'root',
            group   => 'root',
            mode    => '0644',
            source  => 'puppet:///modules/openstack/rocky/neutron/neutron-api-uwsgi.ini',
            notify  => Service['neutron-api'],
            require => Package['neutron-api'];
        '/etc/neutron/api-paste.ini':
            ensure  => 'present',
            owner   => 'root',
            group   => 'root',
            mode    => '0644',
            source  => 'puppet:///modules/openstack/rocky/neutron/api-paste.ini',
            notify  => Service['neutron-api'],
            require => Package['neutron-api'];
        '/var/run/neutron/':
            ensure => directory,
            owner  => 'neutron',
            group  => 'neutron',
            mode   => '0755';

    }
}