]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/lib/puppet/util/openstack.rb
Revert "Add the posibility to tell openstack to use --os_cacert for keystone_tenant"
[dsa-puppet.git] / 3rdparty / modules / keystone / lib / puppet / util / openstack.rb
1 # TODO: This should be extracted into openstacklib during the kilo cycle
2 # Add the auth parameter to whatever type is given
3 module Puppet::Util::Openstack
4   def self.add_openstack_type_methods(type, comment)
5
6     type.newparam(:auth) do
7
8       desc <<EOT
9 Hash of authentication credentials. Credentials can be specified as
10 password credentials, e.g.:
11
12 auth => {
13   'username'    => 'test',
14   'password'    => 'passw0rd',
15   'tenant_name' => 'test',
16   'auth_url'    => 'http://localhost:35357/v2.0',
17 }
18
19 or a path to an openrc file containing these credentials, e.g.:
20
21 auth => {
22   'openrc' => '/root/openrc',
23 }
24
25 or a service token and host, e.g.:
26
27 auth => {
28   'service_token' => 'ADMIN',
29   'auth_url'    => 'http://localhost:35357/v2.0',
30 }
31
32 If not present, the provider will look for environment variables for
33 password credentials.
34
35 #{comment}
36 EOT
37
38       validate do |value|
39         raise(Puppet::Error, 'This property must be a hash') unless value.is_a?(Hash)
40       end
41     end
42
43     type.autorequire(:package) do
44       'python-openstackclient'
45     end
46
47   end
48 end