From 8976aa29d26c6326b79562e083fdc4f79a063c32 Mon Sep 17 00:00:00 2001 From: Andrey Shestakov Date: Wed, 9 Sep 2015 12:17:15 +0300 Subject: [PATCH] Add neutron-ovs to ironic role Change-Id: Ifd4c791e7801ae732ba493b71fcd434032fc7611 --- deployment_scripts/puppet/manifests/ironic.pp | 12 +++- .../puppet/manifests/network-openstack.pp | 43 +------------ .../manifests/network-physnets-conductor.pp | 43 +++++++++++++ .../puppet/manifests/network-physnets.pp | 49 ++++++++++++++ .../puppet/manifests/{network.pp => vips.pp} | 2 +- deployment_tasks.yaml | 64 +++++++++++++++---- post_install.sh | 2 +- 7 files changed, 158 insertions(+), 57 deletions(-) create mode 100644 deployment_scripts/puppet/manifests/network-physnets-conductor.pp create mode 100644 deployment_scripts/puppet/manifests/network-physnets.pp rename deployment_scripts/puppet/manifests/{network.pp => vips.pp} (98%) diff --git a/deployment_scripts/puppet/manifests/ironic.pp b/deployment_scripts/puppet/manifests/ironic.pp index 5555a93..ea955be 100644 --- a/deployment_scripts/puppet/manifests/ironic.pp +++ b/deployment_scripts/puppet/manifests/ironic.pp @@ -5,6 +5,7 @@ $nova_hash = hiera_hash('nova_hash', {}) $access_hash = hiera_hash('access',{}) $public_vip = hiera('public_vip') $management_vip = hiera('management_vip') +$public_ssl_hash = hiera('public_ssl') $network_metadata = hiera_hash('network_metadata', {}) $baremetal_vip = $network_metadata['vips']['baremetal']['ipaddr'] @@ -29,8 +30,17 @@ $db_name = pick($ironic_hash['db_name'], 'ironic') $db_password = pick($ironic_hash['password'], 'ironic') $database_connection = "mysql://${db_name}:${db_password}@${db_host}/${db_name}?charset=utf8&read_timeout=60" +$public_address = $public_ssl_hash['services'] ? { + true => $public_ssl_hash['hostname'], + default => $public_vip, +} +$public_protocol = $public_ssl_hash['services'] ? { + true => 'https', + default => 'http', +} + $region = hiera('region', 'RegionOne') -$public_url = "http://${public_vip}:6385" +$public_url = "${public_protocol}://${public_address}:6385" $admin_url = "http://${management_vip}:6385" $internal_url = "http://${management_vip}:6385" diff --git a/deployment_scripts/puppet/manifests/network-openstack.pp b/deployment_scripts/puppet/manifests/network-openstack.pp index c293cee..f69225a 100644 --- a/deployment_scripts/puppet/manifests/network-openstack.pp +++ b/deployment_scripts/puppet/manifests/network-openstack.pp @@ -1,4 +1,4 @@ -notice('MODULAR: ironic/network.pp') +notice('MODULAR: ironic/network-openstack.pp') $network_scheme = hiera('network_scheme', {}) prepare_network_config($network_scheme) @@ -12,43 +12,6 @@ $baremetal_L3_allocation_pool = $ironic_hash['l3_allocation_pool'] $baremetal_L3_gateway = $ironic_hash['l3_gateway'] -# Physnets -############################### -if $pnets['physnet1'] { - $physnet1 = "physnet1:${pnets['physnet1']['bridge']}" -} -if $pnets['physnet2'] { - $physnet2 = "physnet2:${pnets['physnet2']['bridge']}" -} -$physnet_ironic = "physnet-ironic:br-ironic" -$physnets_array = [$physnet1, $physnet2, $physnet_ironic] -$bridge_mappings = delete_undef_values($physnets_array) - -$br_map_str = join($bridge_mappings, ',') -neutron_agent_ovs { - 'ovs/bridge_mappings': value => $br_map_str; -} - -$flat_networks = ['physnet-ironic'] -neutron_plugin_ml2 { - 'ml2_type_flat/flat_networks': value => join($flat_networks, ','); -} - -service { 'p_neutron-plugin-openvswitch-agent': - ensure => 'running', - enable => true, - provider => 'pacemaker', -} -service { 'p_neutron-dhcp-agent': - ensure => 'running', - enable => true, - provider => 'pacemaker', -} - -Neutron_plugin_ml2<||> ~> Service['p_neutron-plugin-openvswitch-agent'] ~> Service['p_neutron-dhcp-agent'] -Neutron_agent_ovs<||> ~> Service['p_neutron-plugin-openvswitch-agent'] ~> Service['p_neutron-dhcp-agent'] - - # Predefined network ############################### $netdata = { @@ -77,7 +40,3 @@ neutron_router_interface { "router04:baremetal__subnet": ensure => present, } - -# Order -############################### -Neutron_plugin_ml2<||> -> Neutron_agent_ovs<||> -> Openstack::Network::Create_network<||> diff --git a/deployment_scripts/puppet/manifests/network-physnets-conductor.pp b/deployment_scripts/puppet/manifests/network-physnets-conductor.pp new file mode 100644 index 0000000..f20a400 --- /dev/null +++ b/deployment_scripts/puppet/manifests/network-physnets-conductor.pp @@ -0,0 +1,43 @@ +notice('MODULAR: ironic/network-physnets-conductor.pp') + +$network_scheme = hiera('network_scheme', {}) +prepare_network_config($network_scheme) +$neutron_config = hiera_hash('quantum_settings') +$pnets = $neutron_config['L2']['phys_nets'] +$baremetal_network = get_network_role_property('ironic/baremetal', 'network') +$nameservers = $neutron_config['predefined_networks']['net04']['L3']['nameservers'] + +$ironic_hash = hiera_hash('fuel-plugin-ironic', {}) +$baremetal_L3_allocation_pool = $ironic_hash['l3_allocation_pool'] +$baremetal_L3_gateway = $ironic_hash['l3_gateway'] + +# Physnets +############################### +if $pnets['physnet1'] { + $physnet1 = "physnet1:${pnets['physnet1']['bridge']}" +} +if $pnets['physnet2'] { + $physnet2 = "physnet2:${pnets['physnet2']['bridge']}" +} +$physnet_ironic = "physnet-ironic:br-ironic" +$physnets_array = [$physnet1, $physnet2, $physnet_ironic] +$bridge_mappings = delete_undef_values($physnets_array) + +$br_map_str = join($bridge_mappings, ',') +neutron_agent_ovs { + 'ovs/bridge_mappings': value => $br_map_str; +} + +$flat_networks = ['physnet-ironic'] +neutron_plugin_ml2 { + 'ml2_type_flat/flat_networks': value => join($flat_networks, ','); +} + +service { 'neutron-plugin-openvswitch-agent': + ensure => 'running', + enable => true, +} + +Neutron_plugin_ml2<||> ~> Service['neutron-plugin-openvswitch-agent'] +Neutron_agent_ovs<||> ~> Service['neutron-plugin-openvswitch-agent'] + diff --git a/deployment_scripts/puppet/manifests/network-physnets.pp b/deployment_scripts/puppet/manifests/network-physnets.pp new file mode 100644 index 0000000..f282cce --- /dev/null +++ b/deployment_scripts/puppet/manifests/network-physnets.pp @@ -0,0 +1,49 @@ +notice('MODULAR: ironic/network-physnets.pp') + +$network_scheme = hiera('network_scheme', {}) +prepare_network_config($network_scheme) +$neutron_config = hiera_hash('quantum_settings') +$pnets = $neutron_config['L2']['phys_nets'] +$baremetal_network = get_network_role_property('ironic/baremetal', 'network') +$nameservers = $neutron_config['predefined_networks']['net04']['L3']['nameservers'] + +$ironic_hash = hiera_hash('fuel-plugin-ironic', {}) +$baremetal_L3_allocation_pool = $ironic_hash['l3_allocation_pool'] +$baremetal_L3_gateway = $ironic_hash['l3_gateway'] + +# Physnets +############################### +if $pnets['physnet1'] { + $physnet1 = "physnet1:${pnets['physnet1']['bridge']}" +} +if $pnets['physnet2'] { + $physnet2 = "physnet2:${pnets['physnet2']['bridge']}" +} +$physnet_ironic = "physnet-ironic:br-ironic" +$physnets_array = [$physnet1, $physnet2, $physnet_ironic] +$bridge_mappings = delete_undef_values($physnets_array) + +$br_map_str = join($bridge_mappings, ',') +neutron_agent_ovs { + 'ovs/bridge_mappings': value => $br_map_str; +} + +$flat_networks = ['physnet-ironic'] +neutron_plugin_ml2 { + 'ml2_type_flat/flat_networks': value => join($flat_networks, ','); +} + +service { 'p_neutron-plugin-openvswitch-agent': + ensure => 'running', + enable => true, + provider => 'pacemaker', +} +service { 'p_neutron-dhcp-agent': + ensure => 'running', + enable => true, + provider => 'pacemaker', +} + +Neutron_plugin_ml2<||> ~> Service['p_neutron-plugin-openvswitch-agent'] ~> Service['p_neutron-dhcp-agent'] +Neutron_agent_ovs<||> ~> Service['p_neutron-plugin-openvswitch-agent'] ~> Service['p_neutron-dhcp-agent'] + diff --git a/deployment_scripts/puppet/manifests/network.pp b/deployment_scripts/puppet/manifests/vips.pp similarity index 98% rename from deployment_scripts/puppet/manifests/network.pp rename to deployment_scripts/puppet/manifests/vips.pp index 253c272..78f20cb 100644 --- a/deployment_scripts/puppet/manifests/network.pp +++ b/deployment_scripts/puppet/manifests/vips.pp @@ -1,4 +1,4 @@ -notice('MODULAR: ironic/network.pp') +notice('MODULAR: ironic/vips.pp') $network_scheme = hiera('network_scheme', {}) prepare_network_config($network_scheme) diff --git a/deployment_tasks.yaml b/deployment_tasks.yaml index 7c2a85b..08a8db9 100644 --- a/deployment_tasks.yaml +++ b/deployment_tasks.yaml @@ -14,29 +14,69 @@ groups: ['primary-controller', 'controller'] type: puppet required_for: [ironic-api] - requires: [openstack-haproxy, ironic-network] + requires: [openstack-haproxy, ironic-vips] parameters: puppet_manifest: puppet/manifests/haproxy.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 3600 -- id: ironic-network-ovs - groups: ['primary-controller', 'controller'] +- id: ironicopenstack-network-compute type: puppet - required_for: [virtual_ips] + groups: ['ironic'] + required_for: [ironic-physnets-conductor] + requires: [ironic-compute] + parameters: + puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/openstack-network-compute.pp + puppet_modules: /etc/puppet/modules + timeout: 3600 + +- id: ironic-network-ovs + groups: ['primary-controller', 'controller', 'ironic'] + type: puppet + required_for: [virtual_ips, ironic-vips, ironic-openstack-network-compute] requires: [netconfig] parameters: puppet_manifest: puppet/manifests/network-ovs.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 3600 -- id: ironic-network +- id: ironic-physnets + groups: ['primary-controller', 'controller'] + type: puppet + required_for: [ironic-network-openstack] + requires: [ironic-network-ovs, openstack-network] + parameters: + puppet_manifest: puppet/manifests/network-physnets.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 3600 + +- id: ironic-openstack-network-compute + groups: ['ironic'] + type: puppet + required_for: [ironic-physnets-conductor] + requires: [ironic-compute] + parameters: + puppet_manifest: /etc/puppet/modules/osnailyfacter/modular/openstack-network/openstack-network-compute.pp + puppet_modules: /etc/puppet/modules + timeout: 3600 + +- id: ironic-physnets-conductor + groups: ['ironic'] + type: puppet + required_for: [deploy_end] + requires: [ironic-openstack-network-compute] + parameters: + puppet_manifest: puppet/manifests/network-physnets-conductor.pp + puppet_modules: puppet/modules:/etc/puppet/modules + timeout: 3600 + +- id: ironic-vips groups: ['primary-controller', 'controller'] type: puppet required_for: [ironic-haproxy] requires: [openstack-controller, ironic-network-ovs] parameters: - puppet_manifest: puppet/manifests/network.pp + puppet_manifest: puppet/manifests/vips.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 3600 @@ -96,13 +136,13 @@ groups: ['primary-controller', 'controller'] type: puppet required_for: [deploy_end, controller_remaining_tasks] - requires: [openstack-controller, ironic-db, ironic-network, ironic-haproxy] + requires: [openstack-controller, ironic-db, ironic-vips, ironic-haproxy] parameters: puppet_manifest: puppet/manifests/ironic.pp puppet_modules: puppet/modules:/etc/puppet/modules timeout: 3600 -- id: ironic-network-conductor +- id: ironic-conductor-network groups: ['ironic'] type: puppet required_for: [ironic-conductor] @@ -115,8 +155,8 @@ - id: ironic-conductor groups: ['ironic'] type: puppet - required_for: [deploy_end, ironic-compute] - requires: [hosts, firewall, ironic-network-conductor] + required_for: [ironic-compute] + requires: [ironic-conductor-network] parameters: puppet_manifest: puppet/manifests/ironic-conductor.pp puppet_modules: puppet/modules:/etc/puppet/modules @@ -125,8 +165,8 @@ - id: ironic-compute groups: ['ironic'] type: puppet - required_for: [deploy_end] - requires: [hosts, firewall, ironic-conductor] + required_for: [ironic-openstack-network-compute] + requires: [ironic-conductor] parameters: puppet_manifest: puppet/manifests/ironic-compute.pp puppet_modules: puppet/modules:/etc/puppet/modules diff --git a/post_install.sh b/post_install.sh index 81268e8..2ca413f 100755 --- a/post_install.sh +++ b/post_install.sh @@ -21,5 +21,5 @@ export BOOTSTRAP_SSH_KEYS="${key_file}.pub" export AGENT_PACKAGE_PATH="${package_path}/repositories/ubuntu" mkdir -p "${DESTDIR}" -#${deployment_scripts_path}/fuel-bootstrap-image-builder/bin/fuel-bootstrap-image +${deployment_scripts_path}/fuel-bootstrap-image-builder/bin/fuel-bootstrap-image chmod 755 -R "${DESTDIR}"