OS compatibility checks. also, improved error reporting when a node is not found.

This commit is contained in:
Roman Alekseenkov 2013-03-11 16:39:49 -07:00
parent 8eedc3afa1
commit 53de0e725a
7 changed files with 173 additions and 9 deletions

View File

@ -77,6 +77,9 @@ $public_netmask = '255.255.255.0'
$node = filter_nodes($nodes,'name',$::hostname)
if empty($node) {
fail("Node $::hostname is not defined in the hash structure")
}
$internal_address = $node[0]['internal_address']
$public_address = $node[0]['public_address']
@ -515,6 +518,11 @@ class compact_controller (
# Definition of the first OpenStack controller.
node /fuel-controller-01/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -555,6 +563,11 @@ node /fuel-controller-01/ {
# Definition of the second OpenStack controller.
node /fuel-controller-02/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -595,6 +608,11 @@ node /fuel-controller-02/ {
# Definition of the third OpenStack controller.
node /fuel-controller-03/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -635,6 +653,11 @@ node /fuel-controller-03/ {
# Definition of OpenStack compute nodes.
node /fuel-compute-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -694,6 +717,11 @@ node /fuel-compute-[\d+]/ {
# Definition of OpenStack Quantum node.
node /fuel-quantum/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,

View File

@ -77,6 +77,9 @@ $public_netmask = '255.255.255.0'
$node = filter_nodes($nodes,'name',$::hostname)
if empty($node) {
fail("Node $::hostname is not defined in the hash structure")
}
$internal_address = $node[0]['internal_address']
$public_address = $node[0]['public_address']
@ -516,6 +519,11 @@ class compact_controller (
# Definition of the first OpenStack controller.
node /fuel-controller-01/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -556,6 +564,11 @@ node /fuel-controller-01/ {
# Definition of the second OpenStack controller.
node /fuel-controller-02/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -596,6 +609,11 @@ node /fuel-controller-02/ {
# Definition of the third OpenStack controller.
node /fuel-controller-03/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -636,6 +654,11 @@ node /fuel-controller-03/ {
# Definition of OpenStack compute nodes.
node /fuel-compute-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -695,6 +718,11 @@ node /fuel-compute-[\d+]/ {
# Definition of OpenStack Quantum node.
node /fuel-quantum/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,

View File

@ -114,6 +114,9 @@ $public_netmask = '255.255.255.0'
$node = filter_nodes($nodes,'name',$::hostname)
if empty($node) {
fail("Node $::hostname is not defined in the hash structure")
}
$internal_address = $node[0]['internal_address']
$public_address = $node[0]['public_address']
$controller_internal_addresses = nodes_to_hash(filter_nodes($nodes,'role','controller'),'name','internal_address')
@ -543,18 +546,40 @@ class ha_controller (
# Definition of OpenStack controller nodes.
node /fuel-controller-01/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class { ha_controller: quantum_network_node => true }
}
node /fuel-controller-02/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class { ha_controller: quantum_network_node => true }
}
node /fuel-controller-03/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class { ha_controller: quantum_network_node => true }
}
# Definition of OpenStack compute nodes.
node /fuel-compute-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -615,6 +640,11 @@ node /fuel-compute-[\d+]/ {
# Definition of the first OpenStack Swift node.
node /fuel-swift-01/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -644,6 +674,11 @@ node /fuel-swift-01/ {
# Definition of the second OpenStack Swift node.
node /fuel-swift-02/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -673,6 +708,11 @@ node /fuel-swift-02/ {
# Definition of the third OpenStack Swift node.
node /fuel-swift-03/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -702,6 +742,11 @@ node /fuel-swift-03/ {
# Definition of OpenStack Swift proxy nodes.
node /fuel-swiftproxy-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -728,6 +773,11 @@ node /fuel-swiftproxy-[\d+]/ {
# Definition of OpenStack Quantum node.
node /fuel-quantum/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,

View File

@ -77,6 +77,9 @@ $public_netmask = '255.255.255.0'
$node = filter_nodes($nodes,'name',$::hostname)
if empty($node) {
fail("Node $::hostname is not defined in the hash structure")
}
$internal_address = $node[0]['internal_address']
$public_address = $node[0]['public_address']
@ -468,6 +471,11 @@ class compact_controller (
# Definition of OpenStack controller nodes.
node /fuel-controller-01/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -487,7 +495,13 @@ node /fuel-controller-01/ {
}
class { compact_controller: }
}
node /fuel-controller-02/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -507,7 +521,13 @@ node /fuel-controller-02/ {
}
class { compact_controller: }
}
node /fuel-controller-03/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,
@ -530,13 +550,10 @@ node /fuel-controller-03/ {
# Definition of OpenStack compute nodes.
node /fuel-compute-[\d+]/ {
#class {'::node_netconfig':
# mgmt_ipaddr => $::internal_address,
# mgmt_netmask => $::internal_netmask,
# public_ipaddr => $::public_address,
# public_netmask => $::public_netmask,
# stage => 'netconfig',
#}
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'nagios':
proj_name => $proj_name,
@ -589,6 +606,11 @@ node /fuel-compute-[\d+]/ {
# Definition of OpenStack Quantum node.
node /fuel-quantum/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'::node_netconfig':
mgmt_ipaddr => $::internal_address,
mgmt_netmask => $::internal_netmask,

View File

@ -185,6 +185,10 @@ $horizon_use_ssl = false
# Definition of OpenStack controller node.
node /fuel-controller-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'nagios':
proj_name => $proj_name,
@ -249,6 +253,10 @@ node /fuel-controller-[\d+]/ {
# Definition of OpenStack compute nodes.
node /fuel-compute-[\d+]/ {
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class {'nagios':
proj_name => $proj_name,

View File

@ -108,8 +108,10 @@ $openstack_version = {
# Every node should be deployed as all-in-one openstack installations.
node default {
# include 'apache'
include stdlib
class { 'operatingsystem::checksupported':
stage => 'setup'
}
class { 'openstack::all':
public_address => $ipaddress_eth0,

View File

@ -0,0 +1,26 @@
#
# This class is being used to check for compatibility with different operating systems
# If the operating system is not supported, it will fail early
#
class operatingsystem::checksupported () {
case $operatingsystem {
centos, redhat, ubuntu: {}
default: {
fail("Operating system $operatingsystem is not supported")
}
}
case $architecture {
x86_64, amd64: {}
default: {
fail("Architecture $architecture is not supported. 64-bit architecture is required")
}
}
notify { 'operatingsystem':
message => "Detected OS $operatingsystem, architecture $architecture"
}
}