File: neutron.pp

package info (click to toggle)
puppet-module-nova 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,100 kB
  • sloc: ruby: 11,433; python: 38; sh: 10; makefile: 10
file content (148 lines) | stat: -rw-r--r-- 5,712 bytes parent folder | download
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# == Class: nova::network::neutron
#
# Configures Nova network to use Neutron.
#
# === Parameters:
#
# [*password*]
#   (required) Password for connecting to Neutron network services in
#   admin context through the OpenStack Identity service.
#
# [*auth_type*]
#   Name of the auth type to load (string value)
#   Defaults to 'password'
#
# [*project_name*]
#   (optional) Project name for connecting to Neutron network services in
#   admin context through the OpenStack Identity service.
#   Defaults to 'services'
#
# [*project_domain_name*]
#   (optional) Project Domain name for connecting to Neutron network services in
#   admin context through the OpenStack Identity service.
#   Defaults to 'Default'
#
# [*system_scope*]
#   (Optional) Scope for system operations
#   Defaults to $facts['os_service_default']
#
# [*username*]
#   (optional) Username for connecting to Neutron network services in admin context
#   through the OpenStack Identity service.
#   Defaults to 'neutron'
#
# [*user_domain_name*]
#   (optional) User Domain name for connecting to Neutron network services in
#   admin context through the OpenStack Identity service.
#   Defaults to 'Default'
#
# [*auth_url*]
#   (optional) Points to the OpenStack Identity server IP and port.
#   This is the Identity (keystone) admin API server IP and port value,
#   and not the Identity service API IP and port.
#   Defaults to 'http://127.0.0.1:5000/v3'
#
# [*valid_interfaces*]
#   (optional) The endpoint type to lookup when talking to Neutron.
#   Defaults to $facts['os_service_default']
#
# [*endpoint_override*]
#   (optional) Override the endpoint to use to talk to Neutron.
#   Defaults to $facts['os_service_default']
#
# [*timeout*]
#   (optional) Timeout value for connecting to neutron in seconds.
#   Defaults to '30'
#
# [*region_name*]
#   (optional) Region name for connecting to neutron in admin context
#   through the OpenStack Identity service.
#   Defaults to 'RegionOne'
#
# [*http_retries*]
#   (optional) Number of times neutronclient should retry on any failed http
#   call.
#   Defaults to $facts['os_service_default']
#
# [*service_type*]
#   (optional) The default service_type for endpoint URL discovery.
#   Defaults to $facts['os_service_default']
#
# [*ovs_bridge*]
#   (optional) Name of Integration Bridge used by Open vSwitch
#   Defaults to $facts['os_service_default']
#
# [*extension_sync_interval*]
#   (optional) Number of seconds before querying neutron for extensions
#   Defaults to $facts['os_service_default']
#
# [*vif_plugging_is_fatal*]
#   (optional) Fail to boot instance if vif plugging fails.
#   This prevents nova from booting an instance if vif plugging notification
#   is not received from neutron.
#   Defaults to $facts['os_service_default']
#
# [*vif_plugging_timeout*]
#   (optional) Number of seconds to wait for neutron vif plugging events.
#   Set to '0' and vif_plugging_is_fatal to 'False' if vif plugging
#   notification is not being used.
#   Defaults to $facts['os_service_default']
#
# [*default_floating_pool*]
#   (optional) Default pool for floating IPs
#   Defaults to $facts['os_service_default']
#
class nova::network::neutron (
  $password,
  $auth_type               = 'password',
  $project_name            = 'services',
  $project_domain_name     = 'Default',
  $system_scope            = $facts['os_service_default'],
  $username                = 'neutron',
  $user_domain_name        = 'Default',
  $auth_url                = 'http://127.0.0.1:5000/v3',
  $valid_interfaces        = $facts['os_service_default'],
  $endpoint_override       = $facts['os_service_default'],
  $timeout                 = '30',
  $region_name             = 'RegionOne',
  $http_retries            = $facts['os_service_default'],
  $service_type            = $facts['os_service_default'],
  $ovs_bridge              = $facts['os_service_default'],
  $extension_sync_interval = $facts['os_service_default'],
  $vif_plugging_is_fatal   = $facts['os_service_default'],
  $vif_plugging_timeout    = $facts['os_service_default'],
  $default_floating_pool   = $facts['os_service_default'],
) {

  include nova::deps

  if is_service_default($system_scope) {
    $project_name_real = $project_name
    $project_domain_name_real = $project_domain_name
  } else {
    $project_name_real = $facts['os_service_default']
    $project_domain_name_real = $facts['os_service_default']
  }

  nova_config {
    'DEFAULT/vif_plugging_is_fatal':   value => $vif_plugging_is_fatal;
    'DEFAULT/vif_plugging_timeout':    value => $vif_plugging_timeout;
    'neutron/default_floating_pool':   value => $default_floating_pool;
    'neutron/timeout':                 value => $timeout;
    'neutron/project_name':            value => $project_name_real;
    'neutron/project_domain_name':     value => $project_domain_name_real;
    'neutron/system_scope':            value => $system_scope;
    'neutron/region_name':             value => $region_name;
    'neutron/username':                value => $username;
    'neutron/user_domain_name':        value => $user_domain_name;
    'neutron/password':                value => $password, secret => true;
    'neutron/auth_url':                value => $auth_url;
    'neutron/valid_interfaces':        value => join(any2array($valid_interfaces), ',');
    'neutron/endpoint_override':       value => $endpoint_override;
    'neutron/http_retries':            value => $http_retries;
    'neutron/service_type':            value => $service_type;
    'neutron/ovs_bridge':              value => $ovs_bridge;
    'neutron/extension_sync_interval': value => $extension_sync_interval;
    'neutron/auth_type':               value => $auth_type;
  }
}