Merge "Add floating ip for ironic network"
This commit is contained in:
commit
7e2f8affe3
|
@ -1,5 +1,5 @@
|
||||||
class platform::network::pxeboot::params(
|
class platform::network::pxeboot::params(
|
||||||
# shared parametes with base class - required for auto hiera parameter lookup
|
# shared parameters with base class - required for auto hiera parameter lookup
|
||||||
$interface_name = undef,
|
$interface_name = undef,
|
||||||
$interface_address = undef,
|
$interface_address = undef,
|
||||||
$interface_devices = [],
|
$interface_devices = [],
|
||||||
|
@ -20,7 +20,7 @@ class platform::network::pxeboot::params(
|
||||||
|
|
||||||
|
|
||||||
class platform::network::mgmt::params(
|
class platform::network::mgmt::params(
|
||||||
# shared parametes with base class - required for auto hiera parameter lookup
|
# shared parameters with base class - required for auto hiera parameter lookup
|
||||||
$interface_name = undef,
|
$interface_name = undef,
|
||||||
$interface_address = undef,
|
$interface_address = undef,
|
||||||
$interface_devices = [],
|
$interface_devices = [],
|
||||||
|
@ -43,7 +43,7 @@ class platform::network::mgmt::params(
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
class platform::network::oam::params(
|
class platform::network::oam::params(
|
||||||
# shared parametes with base class - required for auto hiera parameter lookup
|
# shared parameters with base class - required for auto hiera parameter lookup
|
||||||
$interface_name = undef,
|
$interface_name = undef,
|
||||||
$interface_address = undef,
|
$interface_address = undef,
|
||||||
$interface_devices = [],
|
$interface_devices = [],
|
||||||
|
@ -63,7 +63,27 @@ class platform::network::oam::params(
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
class platform::network::cluster_host::params(
|
class platform::network::cluster_host::params(
|
||||||
# shared parametes with base class - required for auto hiera parameter lookup
|
# shared parameters with base class - required for auto hiera parameter lookup
|
||||||
|
$interface_name = undef,
|
||||||
|
$interface_address = undef,
|
||||||
|
$interface_devices = [],
|
||||||
|
$subnet_version = undef,
|
||||||
|
$subnet_network = undef,
|
||||||
|
$subnet_network_url = undef,
|
||||||
|
$subnet_prefixlen = undef,
|
||||||
|
$subnet_netmask = undef,
|
||||||
|
$subnet_start = undef,
|
||||||
|
$subnet_end = undef,
|
||||||
|
$gateway_address = undef,
|
||||||
|
$controller_address = undef, # controller floating
|
||||||
|
$controller_address_url = undef, # controller floating url address
|
||||||
|
$controller0_address = undef, # controller unit0
|
||||||
|
$controller1_address = undef, # controller unit1
|
||||||
|
$mtu = 1500,
|
||||||
|
) { }
|
||||||
|
|
||||||
|
class platform::network::ironic::params(
|
||||||
|
# shared parameters with base class - required for auto hiera parameter lookup
|
||||||
$interface_name = undef,
|
$interface_name = undef,
|
||||||
$interface_address = undef,
|
$interface_address = undef,
|
||||||
$interface_devices = [],
|
$interface_devices = [],
|
||||||
|
|
|
@ -41,6 +41,11 @@ class platform::sm
|
||||||
$oam_ip_param_ip = $::platform::network::oam::params::controller_address
|
$oam_ip_param_ip = $::platform::network::oam::params::controller_address
|
||||||
$oam_ip_param_mask = $::platform::network::oam::params::subnet_prefixlen
|
$oam_ip_param_mask = $::platform::network::oam::params::subnet_prefixlen
|
||||||
|
|
||||||
|
include ::platform::network::ironic::params
|
||||||
|
$ironic_ip_interface = $::platform::network::ironic::params::interface_name
|
||||||
|
$ironic_ip_param_ip = $::platform::network::ironic::params::controller_address
|
||||||
|
$ironic_ip_param_mask = $::platform::network::ironic::params::subnet_prefixlen
|
||||||
|
|
||||||
include ::platform::drbd::cgcs::params
|
include ::platform::drbd::cgcs::params
|
||||||
$cgcs_drbd_resource = $::platform::drbd::cgcs::params::resource_name
|
$cgcs_drbd_resource = $::platform::drbd::cgcs::params::resource_name
|
||||||
$cgcs_fs_device = $::platform::drbd::cgcs::params::device
|
$cgcs_fs_device = $::platform::drbd::cgcs::params::device
|
||||||
|
@ -306,6 +311,19 @@ class platform::sm
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Create the Ironic IP service if it is configured
|
||||||
|
if $ironic_ip_interface and $system_mode != 'simplex' {
|
||||||
|
exec { 'Configure Ironic IP service in SM (service-group-member ironic-ip)':
|
||||||
|
command => 'sm-provision service-group-member controller-services ironic-ip',
|
||||||
|
}
|
||||||
|
-> exec { 'Configure Ironic IP service in SM (service ironic-ip)':
|
||||||
|
command => 'sm-provision service ironic-ip',
|
||||||
|
}
|
||||||
|
-> exec { 'Configure Ironic IP':
|
||||||
|
command => "sm-configure service_instance ironic-ip ironic-ip \"ip=${ironic_ip_param_ip},cidr_netmask=${ironic_ip_param_mask},nic=${ironic_ip_interface},arp_count=7\"",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exec { 'Configure Postgres DRBD':
|
exec { 'Configure Postgres DRBD':
|
||||||
command => "sm-configure service_instance drbd-pg drbd-pg:${hostunit} \"drbd_resource=${pg_drbd_resource}\"",
|
command => "sm-configure service_instance drbd-pg drbd-pg:${hostunit} \"drbd_resource=${pg_drbd_resource}\"",
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,6 +278,19 @@ class InterfacePuppet(base.BasePuppet):
|
||||||
except exception.AddressNotFoundByName:
|
except exception.AddressNotFoundByName:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
ironic_address = self._get_address_by_name(
|
||||||
|
constants.CONTROLLER_HOSTNAME, constants.NETWORK_TYPE_IRONIC)
|
||||||
|
|
||||||
|
ironic_floating_ip = (str(ironic_address.address) + '/' +
|
||||||
|
str(ironic_address.prefix))
|
||||||
|
|
||||||
|
floating_ips.update({
|
||||||
|
constants.NETWORK_TYPE_IRONIC: ironic_floating_ip,
|
||||||
|
})
|
||||||
|
except exception.AddressNotFoundByName:
|
||||||
|
pass
|
||||||
|
|
||||||
return floating_ips
|
return floating_ips
|
||||||
|
|
||||||
def _get_datanetworks(self, host):
|
def _get_datanetworks(self, host):
|
||||||
|
|
|
@ -22,6 +22,7 @@ class NetworkingPuppet(base.BasePuppet):
|
||||||
config.update(self._get_mgmt_network_config())
|
config.update(self._get_mgmt_network_config())
|
||||||
config.update(self._get_oam_network_config())
|
config.update(self._get_oam_network_config())
|
||||||
config.update(self._get_cluster_network_config())
|
config.update(self._get_cluster_network_config())
|
||||||
|
config.update(self._get_ironic_network_config())
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def get_host_config(self, host):
|
def get_host_config(self, host):
|
||||||
|
@ -29,6 +30,7 @@ class NetworkingPuppet(base.BasePuppet):
|
||||||
config.update(self._get_pxeboot_interface_config())
|
config.update(self._get_pxeboot_interface_config())
|
||||||
config.update(self._get_mgmt_interface_config())
|
config.update(self._get_mgmt_interface_config())
|
||||||
config.update(self._get_cluster_interface_config())
|
config.update(self._get_cluster_interface_config())
|
||||||
|
config.update(self._get_ironic_interface_config())
|
||||||
if host.personality == constants.CONTROLLER:
|
if host.personality == constants.CONTROLLER:
|
||||||
config.update(self._get_oam_interface_config())
|
config.update(self._get_oam_interface_config())
|
||||||
return config
|
return config
|
||||||
|
@ -90,6 +92,11 @@ class NetworkingPuppet(base.BasePuppet):
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
|
def _get_ironic_network_config(self):
|
||||||
|
networktype = constants.NETWORK_TYPE_IRONIC
|
||||||
|
config = self._get_network_config(networktype)
|
||||||
|
return config
|
||||||
|
|
||||||
def _get_network_config(self, networktype):
|
def _get_network_config(self, networktype):
|
||||||
try:
|
try:
|
||||||
network = self.dbapi.network_get_by_type(networktype)
|
network = self.dbapi.network_get_by_type(networktype)
|
||||||
|
@ -172,6 +179,9 @@ class NetworkingPuppet(base.BasePuppet):
|
||||||
def _get_cluster_interface_config(self):
|
def _get_cluster_interface_config(self):
|
||||||
return self._get_interface_config(constants.NETWORK_TYPE_CLUSTER_HOST)
|
return self._get_interface_config(constants.NETWORK_TYPE_CLUSTER_HOST)
|
||||||
|
|
||||||
|
def _get_ironic_interface_config(self):
|
||||||
|
return self._get_interface_config(constants.NETWORK_TYPE_IRONIC)
|
||||||
|
|
||||||
def _get_interface_config(self, networktype):
|
def _get_interface_config(self, networktype):
|
||||||
config = {}
|
config = {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue