From d79db30418e4f1f21150ec29aa8000d2df10284b Mon Sep 17 00:00:00 2001 From: Yolanda Robla Mota Date: Fri, 16 Sep 2016 17:00:33 +0200 Subject: [PATCH] Add network config for puppet-infracloud on hiera Stop hardcoding the network settings on the modules and instead of that, use parameters and rely on public hiera. Change-Id: I3cccfc03609bf90503b3fe27d3e717f89f6ec654 --- hiera/group/infracloud.yaml | 8 +++++ manifests/site.pp | 26 +++++++++------- .../manifests/infracloud/baremetal.pp | 30 +++++++++++++------ 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/hiera/group/infracloud.yaml b/hiera/group/infracloud.yaml index 018dee6548..f6115a9dc1 100644 --- a/hiera/group/infracloud.yaml +++ b/hiera/group/infracloud.yaml @@ -2901,3 +2901,11 @@ ironic_inventory: rabbitmq::package_gpg_key: 'https://www.rabbitmq.com/rabbitmq-release-signing-key.asc' rabbitmq::repo::apt::key: '0A9AF2115F4687BD29803A206B73A36E6026DFCA' bridge_name: br-vlan2551 +vlan: '2551' +gateway_ip: '15.184.64.1' +default_network_interface: 'eth2' +network_interface: 'eth2' +ipv4_nameserver: '8.8.8.8' +ipv4_subnet_mask: '255.255.224.0' +dhcp_pool_start: '10.10.16.144' +dhcp_pool_end: '10.10.16.190' diff --git a/manifests/site.pp b/manifests/site.pp index 36cb02bbe0..037a4994a1 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -1428,17 +1428,21 @@ node /^baremetal\d{2}\.vanilla\.ic\.openstack\.org$/ { } class { '::openstack_project::infracloud::baremetal': - # NOTE(pabelanger): hiera should be updated to reflect our new region - # names. - ironic_inventory => hiera('ironic_inventory', {}), - ironic_db_password => hiera('ironic_db_password'), - mysql_password => hiera('bifrost_mysql_password'), - ipmi_passwords => hiera('ipmi_passwords'), - ssh_private_key => hiera('bifrost_vanilla_ssh_private_key'), - ssh_public_key => hiera('bifrost_vanilla_ssh_public_key'), - bridge_name => hiera('bridge_name'), - vlan => 2551, - gateway_ip => '15.184.64.1', + ironic_inventory => hiera('ironic_inventory', {}), + ironic_db_password => hiera('ironic_db_password'), + mysql_password => hiera('bifrost_mysql_password'), + ipmi_passwords => hiera('ipmi_passwords'), + ssh_private_key => hiera('bifrost_vanilla_ssh_private_key'), + ssh_public_key => hiera('bifrost_vanilla_ssh_public_key'), + bridge_name => hiera('bridge_name'), + vlan => hiera('vlan'), + gateway_ip => hiera('gateway_ip'), + default_network_interface => hiera('default_network_interface'), + dhcp_pool_start => hiera('dhcp_pool_start'), + dhcp_pool_end => hiera('dhcp_pool_end'), + network_interface => hiera('network_interface'), + ipv4_nameserver => hiera('ipv4_nameserver'), + ipv4_subnet_mask => hiera('ipv4_subnet_mask'), } } diff --git a/modules/openstack_project/manifests/infracloud/baremetal.pp b/modules/openstack_project/manifests/infracloud/baremetal.pp index 9b0f8f0f01..fb74a8d5b8 100644 --- a/modules/openstack_project/manifests/infracloud/baremetal.pp +++ b/modules/openstack_project/manifests/infracloud/baremetal.pp @@ -10,17 +10,29 @@ class openstack_project::infracloud::baremetal ( $bridge_name, $vlan, $gateway_ip, + $default_network_interface, + $dhcp_pool_start, + $dhcp_pool_end, + $network_interface, + $ipv4_nameserver, + $ipv4_subnet_mask, ) { class { '::infracloud::bifrost': - bridge_name => $bridge_name, - ironic_inventory => $ironic_inventory, - ironic_db_password => $ironic_db_password, - mysql_password => $mysql_password, - ipmi_passwords => $ipmi_passwords, - ssh_private_key => $ssh_private_key, - ssh_public_key => $ssh_public_key, - vlan => $vlan, - gateway_ip => $gateway_ip, + bridge_name => $bridge_name, + ironic_inventory => $ironic_inventory, + ironic_db_password => $ironic_db_password, + mysql_password => $mysql_password, + ipmi_passwords => $ipmi_passwords, + ssh_private_key => $ssh_private_key, + ssh_public_key => $ssh_public_key, + vlan => $vlan, + gateway_ip => $gateway_ip, + default_network_interface => $default_network_interface, + dhcp_pool_start => $dhcp_pool_start, + dhcp_pool_end => $dhcp_pool_end, + network_interface => $network_interface, + ipv4_nameserver => $ipv4_nameserver, + ipv4_subnet_mask => $ipv4_subnet_mask, } realize (