X-Git-Url: https://git.donarmstrong.com/?p=dsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fnova%2Flib%2Fpuppet%2Ftype%2Fnova_cells.rb;fp=3rdparty%2Fmodules%2Fnova%2Flib%2Fpuppet%2Ftype%2Fnova_cells.rb;h=77098f1e95e5b17bacc491ac2b5d23303239ece0;hp=0000000000000000000000000000000000000000;hb=4631045ebb77ee8622f6fa09277a50c372bcc02e;hpb=3d4dc4fd9e59bd0e07646c99f6b356c7d9d859aa diff --git a/3rdparty/modules/nova/lib/puppet/type/nova_cells.rb b/3rdparty/modules/nova/lib/puppet/type/nova_cells.rb new file mode 100644 index 00000000..77098f1e --- /dev/null +++ b/3rdparty/modules/nova/lib/puppet/type/nova_cells.rb @@ -0,0 +1,115 @@ +# +# Copyright (C) 2013 eNovance SAS +# +# Author: Emilien Macchi +# François Charlier +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# +# nova_cells type +# +# == Parameters +# [*name*] +# Name for the new cell +# Optional +# +# [*cell_type*] +# Whether the cell is a 'parent' or 'child' +# Required +# +# [*rabbit_username*] +# Username for the message broker in this cell +# Optional +# +# [*rabbit_password*] +# Password for the message broker in this cell +# Optional +# +# [*rabbit_hosts*] +# Address of the message broker in this cell +# Optional +# +# [*rabbit_port*] +# Port number of the message broker in this cell +# Optional +# +# [*rabbit_virtual_host*] +# The virtual host of the message broker in this cell +# Optional +# +# [*weight_offset*] +# It might be used by some cell scheduling code in the future +# Optional +# +# [*weight_scale*] +# It might be used by some cell scheduling code in the future +# Optional +# + +Puppet::Type.newtype(:nova_cells) do + + @doc = "Manage creation/deletion of nova cells." + + ensurable + + newparam(:name) do + desc "Name for the new cell" + defaultto "api" + end + + newparam(:cell_type) do + desc 'Whether the cell is a parent or child' + end + + newparam(:rabbit_username) do + desc 'Username for the message broker in this cell' + defaultto "guest" + end + + newparam(:rabbit_password) do + desc 'Password for the message broker in this cell' + defaultto "guest" + end + + newparam(:rabbit_port) do + desc 'Port number for the message broker in this cell' + defaultto "5672" + end + + newparam(:rabbit_hosts) do + desc 'Address of the message broker in this cell' + defaultto "localhost" + end + + newparam(:rabbit_virtual_host) do + desc 'The virtual host of the message broker in this cell' + defaultto "/" + end + + newparam(:weight_offset) do + desc 'It might be used by some cell scheduling code in the future' + defaultto "1.0" + end + + newparam(:weight_scale) do + desc 'It might be used by some cell scheduling code in the future' + defaultto "1.0" + end + + + validate do + raise(Puppet::Error, 'Cell type must be set') unless self[:cell_type] + end + +end