Merge "auth_file: allow to change the path"

This commit is contained in:
Jenkins 2015-07-08 16:02:04 +00:00 committed by Gerrit Code Review
commit ab8ddaff93
2 changed files with 18 additions and 1 deletions

View File

@ -64,6 +64,10 @@
# (optional) The method to use for authentication
# Defaults to 'keystone'.
#
# [*path*]
# (optional) File path
# Defaults to '/root/openrc'.
#
class openstack_extras::auth_file(
$password = undef,
$auth_url = 'http://127.0.0.1:5000/v2.0/',
@ -79,11 +83,12 @@ class openstack_extras::auth_file(
$nova_endpoint_type = 'publicURL',
$neutron_endpoint_type = 'publicURL',
$auth_strategy = 'keystone',
$path = '/root/openrc',
) {
if ! $password {
fail('You must specify a password for openstack_extras::auth_file')
}
file { '/root/openrc':
file { $path:
owner => 'root',
group => 'root',
mode => '0700',

View File

@ -83,4 +83,16 @@ describe 'openstack_extras::auth_file' do
])
end
end
describe "when the file is in /tmp" do
let :params do
{
:password => 'secret',
:path => '/tmp/openrc'
}
end
it { should contain_file('/tmp/openrc')}
end
end