Skip to content
Browse files

Add openstack::auth_file class

This commit adds a class called openstack::auth_file
that creates the file openrc with admin credentials
that can be used to authenticate.
  • Loading branch information...
1 parent 9f45813 commit 6004ceae3f1497d3de7699b43c7e70f43ae4dda4 Dan Bode committed May 8, 2012
Showing with 26 additions and 1 deletion.
  1. +1 −1 files/nova_test.sh
  2. +25 −0 manifests/auth_file.pp
View
2 files/nova_test.sh
@@ -2,7 +2,7 @@
#
# assumes that resonable credentials have been stored at
# /root/auth
-source /root/auth
+source /root/openrc
# get an image to test with
#wget http://uec-images.ubuntu.com/releases/11.10/release/ubuntu-11.10-server-cloudimg-amd64-disk1.img
View
25 manifests/auth_file.pp
@@ -0,0 +1,25 @@
+#
+# Creates an auth file that can be used to export
+# environment variables that can be used to authenticate
+# against a keystone server.
+#
+class openstack::auth_file(
+ $admin_password,
+ $controller_node = '127.0.0.1',
+ $keystone_admin_token = 'keystone_admin_token',
+ $admin_user = 'admin',
+ $admin_tenant = 'openstack'
+) {
+ file { '/root/openrc':
+ content =>
+ "
+ export OS_TENANT_NAME=${admin_tenant}
+ export OS_USERNAME=${admin_user}
+ export OS_PASSWORD=${admin_password}
+ export OS_AUTH_URL=\"http://${controller_node}:5000/v2.0/\"
+ export OS_AUTH_STRATEGY=keystone
+ export SERVICE_TOKEN=${keystone_admin_token}
+ export SERVICE_ENDPOINT=http://${controller_node}:35357/v2.0/
+ "
+ }
+}

0 comments on commit 6004cea

Please sign in to comment.
Something went wrong with that request. Please try again.