2 File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
3 require 'puppet/util/openstack'
4 Puppet::Type.newtype(:keystone_user_role) do
7 This is currently used to model the creation of
10 User roles are an assignment of a role to a user on
11 a certain tenant. The combination of all of these
17 newparam(:name, :namevar => true) do
18 newvalues(/^\S+@\S+$/)
21 newproperty(:roles, :array_matching => :all) do
23 return false unless is.is_a? Array
24 # order of roles does not matter
25 is.sort == self.should.sort
29 autorequire(:keystone_user) do
30 self[:name].rpartition('@').first
33 autorequire(:keystone_tenant) do
34 self[:name].rpartition('@').last
37 autorequire(:keystone_role) do
41 # we should not do anything until the keystone service is started
42 autorequire(:service) do
47 If no other credentials are present, the provider will search in
48 /etc/keystone/keystone.conf for an admin token and auth url.
50 Puppet::Util::Openstack.add_openstack_type_methods(self, auth_param_doc)