]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/openstacklib/lib/puppet/util/aviator.rb
bc24b025d72bd88e183319fa6a73da741d04c7a3
[dsa-puppet.git] / 3rdparty / modules / openstacklib / lib / puppet / util / aviator.rb
1 # Add the auth parameter to whatever type is given
2 module Puppet::Util::Aviator
3   def self.add_aviator_params(type)
4
5     type.newparam(:auth) do
6
7       desc <<EOT
8 Hash of authentication credentials. Credentials can be specified as
9 password credentials, e.g.:
10
11 auth => {
12   'username'    => 'test',
13   'password'    => 'passw0rd',
14   'tenant_name' => 'test',
15   'host_uri'    => 'http://localhost:35357/v2.0',
16 }
17
18 or a path to an openrc file containing these credentials, e.g.:
19
20 auth => {
21   'openrc' => '/root/openrc',
22 }
23
24 or a service token and host, e.g.:
25
26 auth => {
27   'service_token' => 'ADMIN',
28   'host_uri'    => 'http://localhost:35357/v2.0',
29 }
30
31 If not present, the provider will first look for environment variables
32 for password credentials and then to /etc/keystone/keystone.conf for a
33 service token.
34 EOT
35
36       validate do |value|
37         raise(Puppet::Error, 'This property must be a hash') unless value.is_a?(Hash)
38       end
39     end
40
41     type.newparam(:log_file) do
42       desc 'Log file. Defaults to no logging.'
43       defaultto('/dev/null')
44     end
45   end
46 end