File: standalone.pp

package info (click to toggle)
puppet-module-manila 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,804 kB
  • sloc: ruby: 4,767; python: 38; makefile: 10; sh: 10
file content (65 lines) | stat: -rw-r--r-- 2,683 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
# == define: manila::network::standalone
#
# Setup and configure Manila standalone network communication
#
# === Parameters
#
# [*standalone_network_plugin_gateway*]
# (required) Gateway IPv4 address that should be used. Required
#
# [*standalone_network_plugin_mask*]
# (required) Network mask that will be used. Can be either decimal
# like '24' or binary like '255.255.255.0'. Required.
#
# [*standalone_network_plugin_segmentation_id*]
# (optional) Set it if network has segmentation (VLAN, VXLAN, etc...).
# It will be assigned to share-network and share drivers will be
# able to use this for network interfaces within provisioned
# share servers. Optional. Example: 1001
# Defaults to $facts['os_service_default']
#
# [*standalone_network_plugin_allowed_ip_ranges*]
# (optional) Can be IP address, range of IP addresses or list of addresses
# or ranges. Contains addresses from IP network that are allowed
# to be used. If empty, then will be assumed that all host
# addresses from network can be used. Optional.
# Examples: 10.0.0.10 or 10.0.0.10-10.0.0.20 or
# 10.0.0.10-10.0.0.20,10.0.0.30-10.0.0.40,10.0.0.50
# Defaults to $facts['os_service_default']
#
# [*network_plugin_ipv4_enabled*]
# (optional) Whether to support Ipv4 network resource
# Defaults to $facts['os_service_default']
#
# [*network_plugin_ipv6_enabled*]
# (optional) whether to support IPv6 network resource
# Defaults to $facts['os_service_default']
#
define manila::network::standalone (
  $standalone_network_plugin_gateway,
  $standalone_network_plugin_mask,
  $standalone_network_plugin_segmentation_id   = $facts['os_service_default'],
  $standalone_network_plugin_allowed_ip_ranges = $facts['os_service_default'],
  $network_plugin_ipv4_enabled                 = $facts['os_service_default'],
  $network_plugin_ipv6_enabled                 = $facts['os_service_default'],
) {

  $standalone_plugin_name = 'manila.network.standalone_network_plugin.StandaloneNetworkPlugin'

  manila_config {
    "${name}/network_api_class":
      value => $standalone_plugin_name;
    "${name}/standalone_network_plugin_gateway":
      value => $standalone_network_plugin_gateway;
    "${name}/standalone_network_plugin_mask":
      value => $standalone_network_plugin_mask;
    "${name}/standalone_network_plugin_segmentation_id":
      value => $standalone_network_plugin_segmentation_id;
    "${name}/standalone_network_plugin_allowed_ip_ranges":
      value => join(any2array($standalone_network_plugin_allowed_ip_ranges), ',');
    "${name}/network_plugin_ipv4_enabled":
      value => $network_plugin_ipv4_enabled;
    "${name}/network_plugin_ipv6_enabled":
      value => $network_plugin_ipv6_enabled;
  }
}