Puppet Class: cubbystack::neutron::dhcp
- Defined in:
- manifests/neutron/dhcp.pp
Overview
Class: cubbystack::neutron::dhcp
Configures the neutron-dhcp
Parameters
- package_ensure
- 
The status of the neutron-dhcp package Defaults to latest 
- service_enable
- 
The status of the neutron-dhcp service Defaults to true 
- settings
- 
A hash of key => value settings to go in dhcp_agent.ini 
- config_file
- 
The path to dhcp_agent.ini Defaults to /etc/neutron/dhcp_agent.ini 
| 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 | # File 'manifests/neutron/dhcp.pp', line 22
class cubbystack::neutron::dhcp (
  $settings,
  $package_ensure = latest,
  $service_enable = true,
  $config_file    = '/etc/neutron/dhcp_agent.ini',
) {
  include ::cubbystack::params
  ## Meta settings and globals
  $tags = ['openstack', 'neutron', 'neutron-dhcp']
  # Make sure Neutron DHCP is installed before any configuration begins
  # Make sure Neutron DHCP is configured before the service starts
  Package<| tag =='neutron' |> -> Cubbystack_config<| tag == 'neutron-dhcp' |>
  Package<| tag =='neutron' |> -> File<| tag == 'neutron-dhcp' |>
  Cubbystack_config<| tag == 'neutron-dhcp' |> -> Service['neutron-dhcp']
  # Restart neutron-dhcp after any config changes
  Cubbystack_config<| tag == 'neutron-dhcp' |> ~> Service['neutron-dhcp']
  File {
    ensure => present,
    owner  => 'neutron',
    group  => 'neutron',
    mode   => '0640',
    tag    => $tags,
    notify => Service['neutron-dhcp'],
  }
  ## Neutron DHCP configuration
  file { $config_file: }
  # Configure the DHCP service
  $settings.each |$setting, $value| {
    cubbystack_config { "${config_file}: ${setting}":
      value => $value,
      tag   => $tags,
    }
  }
  cubbystack::functions::generic_service { 'neutron-dhcp':
    service_enable => $service_enable,
    package_ensure => $package_ensure,
    package_name   => $::cubbystack::params::neutron_dhcp_package_name,
    service_name   => $::cubbystack::params::neutron_dhcp_service_name,
    tags           => $tags,
  }
} |