diff --git a/manifests/auth_file.pp b/manifests/auth_file.pp index 193df36..ab21a2f 100644 --- a/manifests/auth_file.pp +++ b/manifests/auth_file.pp @@ -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', diff --git a/spec/classes/openstack_extras_auth_file_spec.rb b/spec/classes/openstack_extras_auth_file_spec.rb index 6052b07..1e695b8 100644 --- a/spec/classes/openstack_extras_auth_file_spec.rb +++ b/spec/classes/openstack_extras_auth_file_spec.rb @@ -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