commit
44984fd39e
|
@ -1,16 +0,0 @@
|
|||
Puppet::Type.type(:nova_admin).provide(:default) do
|
||||
|
||||
desc "This is a default provider that does nothing. This allows us to install nova-manage on the same puppet run where we want to use it."
|
||||
|
||||
def create
|
||||
return false
|
||||
end
|
||||
|
||||
def destroy
|
||||
return false
|
||||
end
|
||||
|
||||
def exists?
|
||||
fail('This is just the default provider for nova_admin, all it does is fail')
|
||||
end
|
||||
end
|
|
@ -2,9 +2,7 @@ Puppet::Type.type(:nova_admin).provide(:nova_manage) do
|
|||
|
||||
desc "Manage nova admin user"
|
||||
|
||||
defaultfor :kernel => 'Linux'
|
||||
|
||||
commands :nova_manage => 'nova-manage'
|
||||
optional_commands :nova_manage => 'nova-manage'
|
||||
|
||||
def exists?
|
||||
nova_manage("user", "list").match(/^#{resource[:name]}$/)
|
||||
|
|
|
@ -14,7 +14,7 @@ Puppet::Type.type(:nova_config).provide(
|
|||
text_line :blank, :match => /^\s*$/;
|
||||
|
||||
record_line :parsed,
|
||||
:fields => %w{line},
|
||||
:fields => %w{line},
|
||||
:match => /--(.*)/ ,
|
||||
:post_parse => proc { |hash|
|
||||
Puppet.debug("nova config line:#{hash[:line]} has been parsed")
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
Puppet::Type.type(:nova_network).provide(:default) do
|
||||
|
||||
desc "This is a default provider that does nothing. This allows us to install nova-manage on the same puppet run where we want to use it."
|
||||
|
||||
def create
|
||||
return false
|
||||
end
|
||||
|
||||
def destroy
|
||||
return false
|
||||
end
|
||||
|
||||
def exists?
|
||||
fail('This is just the default provider for nova_admin, all it does is fail')
|
||||
end
|
||||
end
|
|
@ -2,13 +2,14 @@ Puppet::Type.type(:nova_network).provide(:nova_manage) do
|
|||
|
||||
desc "Manage nova network"
|
||||
|
||||
defaultfor :kernel => 'Linux'
|
||||
|
||||
commands :nova_manage => 'nova-manage'
|
||||
optional_commands :nova_manage => 'nova-manage'
|
||||
|
||||
def exists?
|
||||
begin
|
||||
nova_manage("network", "list").match(/^#{resource[:network]}\/[0-9]{1,2} /)
|
||||
network_list = nova_manage("network", "list")
|
||||
return network_list.split("\n")[1..-1].detect do |n|
|
||||
n =~ /^(\S+)\s+(#{resource[:network]})/
|
||||
end
|
||||
rescue
|
||||
return false
|
||||
end
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
Puppet::Type.type(:nova_project).provide(:default) do
|
||||
|
||||
desc "This is a default provider that does nothing. This allows us to install nova-manage on the same puppet run where we want to use it."
|
||||
|
||||
def create
|
||||
return false
|
||||
end
|
||||
|
||||
def destroy
|
||||
return false
|
||||
end
|
||||
|
||||
def exists?
|
||||
fail('This is just the default provider for nova_project, all it does is fail')
|
||||
end
|
||||
|
||||
end
|
|
@ -2,9 +2,7 @@ Puppet::Type.type(:nova_project).provide(:nova_manage) do
|
|||
|
||||
desc "Manage nova project"
|
||||
|
||||
defaultfor :kernel => 'Linux'
|
||||
|
||||
commands :nova_manage => 'nova-manage'
|
||||
optional_commands :nova_manage => 'nova-manage'
|
||||
|
||||
def exists?
|
||||
nova_manage("project", "list").match(/^#{resource[:name]}$/)
|
||||
|
|
|
@ -7,7 +7,6 @@ define nova::manage::network ( $network, $available_ips ) {
|
|||
ensure => present,
|
||||
network => $network,
|
||||
available_ips => $available_ips,
|
||||
provider => 'nova_manage',
|
||||
notify => Exec["nova-db-sync"],
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ define nova::manage::project ( $owner ) {
|
|||
|
||||
nova_project { $name:
|
||||
ensure => present,
|
||||
provider => 'nova_manage',
|
||||
owner => $owner,
|
||||
notify => Exec["nova-db-sync"],
|
||||
require => Nova::Manage::Admin[$owner],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# bridge.pp
|
||||
define nova::network::bridge ( $ip, $netmask = "255.255.255.0" )
|
||||
{
|
||||
case $operatingsystem {
|
||||
case $::operatingsystem {
|
||||
|
||||
'debian', 'ubuntu': {
|
||||
$context = "/files/etc/network/interfaces"
|
||||
|
|
|
@ -15,7 +15,7 @@ describe 'Puppet::Type.type(:nova_config)' do
|
|||
Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :absent)
|
||||
end
|
||||
it 'should require a value when ensure is present' do
|
||||
expect { Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :present) }.should raise_error(Puppet::Error, 'Property value must be set when ensure is present')
|
||||
expect { Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :present) }.should raise_error(Puppet::Error, /Property value must be set/)
|
||||
end
|
||||
it 'should accept a valid value' do
|
||||
@nova_config[:value] = 'bar'
|
||||
|
|
Loading…
Reference in New Issue