Puppet Class: tripleo::profile::base::neutron::dhcp_agent_wrappers

Defined in:
manifests/profile/base/neutron/dhcp_agent_wrappers.pp

Overview

Copyright 2018 Red Hat, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Class: tripleo::profile::base::neutron::dhcp_agent_wrappers

Generates wrapper scripts for running dhcp agent subprocesess in containers.

Parameters

enable_dnsmasq_wrapper

(Optional) If true, generates a wrapper for running dnsmasq in a docker container. Defaults to false

dnsmasq_process_wrapper

(Optional) Filename for dnsmasq wrapper in the specified file. Defaults to undef

dnsmasq_image

(Optional) Docker image name for dnsmasq. Required if dnsmasq_process_wrapper is set. Defaults to undef

enable_haproxy_wrapper

(Optional) If true, generates a wrapper for running haproxy in a docker container. Defaults to false

haproxy_process_wrapper

(Optional) If set, generates a haproxy wrapper in the specified file. Defaults to undef

haproxy_image

(Optional) Docker image name for haproxy. Required if haproxy_process_wrapper is set. Defaults to undef

bind_sockets

(Deprecated) Domain sockets that the wrappers should use for accessing the docker daemon. Defaults to hiera(‘docker_additional_sockets’, [‘/var/lib/openstack/docker.sock’])

debug

(Optional) Debug messages for the wrapper scripts. Defaults to False.

Parameters:

  • enable_dnsmasq_wrapper (Any) (defaults to: false)
  • dnsmasq_process_wrapper (Any) (defaults to: undef)
  • dnsmasq_image (Any) (defaults to: undef)
  • enable_haproxy_wrapper (Any) (defaults to: false)
  • haproxy_process_wrapper (Any) (defaults to: undef)
  • haproxy_image (Any) (defaults to: undef)
  • debug (Boolean) (defaults to: false)
  • bind_sockets (Any) (defaults to: hiera('docker_additional_sockets', ['/var/lib/openstack/docker.sock']))


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
# File 'manifests/profile/base/neutron/dhcp_agent_wrappers.pp', line 58

class tripleo::profile::base::neutron::dhcp_agent_wrappers (
  $enable_dnsmasq_wrapper  = false,
  $dnsmasq_process_wrapper = undef,
  $dnsmasq_image           = undef,
  $enable_haproxy_wrapper  = false,
  $haproxy_process_wrapper = undef,
  $haproxy_image           = undef,
  Boolean $debug           = false,

  # Deprecated
  $bind_sockets            = hiera('docker_additional_sockets', ['/var/lib/openstack/docker.sock']),
) {
  $container_cli = hiera('tripleo::profile::base::neutron::container_cli', 'docker')
  if $bind_sockets and $container_cli == 'docker' {
    warning('Docker runtime is deprecated. Consider switching container_cli to podman')
    $bind_socket = join(['unix://', $bind_sockets[0]], '')
  } else {
    $bind_socket = ''
  }
  if $enable_dnsmasq_wrapper {
    unless $dnsmasq_image and $dnsmasq_process_wrapper{
      fail('The docker image for dnsmasq and wrapper filename must be provided when generating dnsmasq wrappers')
    }
    tripleo::profile::base::neutron::wrappers::dnsmasq{'dhcp_dnsmasq_process_wrapper':
      dnsmasq_process_wrapper => $dnsmasq_process_wrapper,
      dnsmasq_image           => $dnsmasq_image,
      bind_socket             => $bind_socket,
      debug                   => $debug,
      container_cli           => $container_cli,
    }
  }

  if $enable_haproxy_wrapper {
    unless $haproxy_image and $haproxy_process_wrapper{
      fail('The docker image for haproxy and wrapper filename must be provided when generating haproxy wrappers')
    }
    tripleo::profile::base::neutron::wrappers::haproxy{'dhcp_haproxy_process_wrapper':
      haproxy_process_wrapper => $haproxy_process_wrapper,
      haproxy_image           => $haproxy_image,
      bind_socket             => $bind_socket,
      debug                   => $debug,
      container_cli           => $container_cli,
    }
  }
}