auth_file: allow to change the path

Default path is /root/openrc. Some use-cases might want to change the
path.

Change-Id: I2e37e3e968f6885916c5632fc60368fca04cd434
This commit is contained in:
Emilien Macchi 2015-06-22 19:11:45 -04:00
parent 7ab1f4544a
commit 6cb5b076f3
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