Skip to content
Snippets Groups Projects
Commit 27c2eb6a authored by Alessandro Costantini's avatar Alessandro Costantini
Browse files

openrc file added to controller role

parent 98de9435
No related branches found
No related tags found
1 merge request!11openrc file added to controller role
class iaas::profile::auth_file (
#$region = hiera('iaas::region', undef),
) {
class { 'iaas::resources::auth_file':
admin_tenant => $::iaas::profile::keystone::admin_tenant,
admin_password => $::iaas::profile::keystone::admin_password,
# region_name => $region,
region_name => hiera('iaas::region', undef),
# controller_node => $::iaas::role::endpoint::main_hostname,
controller_node => hiera('iaas::role::endpoint::main_hostname' , undef),
}
}
# == Class: iaas::resources::auth_file
#
# Creates an auth file that can be used to export
# environment variables that can be used to authenticate
# against a keystone server.
#
# === Parameters
#
# [*admin_password*]
# (required) Admin password.
# [*controller_node*]
# (optional) Keystone address. Defaults to '127.0.0.1'.
# [*keystone_admin_token*]
# (optional) Admin token.
# NOTE: This setting will trigger a warning from keystone.
# Authentication credentials will be ignored by keystone client
# in favor of token authentication. Defaults to undef.
# [*admin_user*]
# (optional) Defaults to 'admin'.
# [*admin_tenant*]
# (optional) Defaults to 'openstack'.
# [*region_name*]
# (optional) Defaults to 'RegionOne'.
# [*use_no_cache*]
# (optional) Do not use the auth token cache. Defaults to true.
# [*cinder_endpoint_type*]
# (optional) Defaults to 'publicURL'.
# [*glance_endpoint_type*]
# (optional) Defaults to 'publicURL'.
# [*keystone_endpoint_type*]
# (optional) Defaults to 'publicURL'.
# [*nova_endpoint_type*]
# (optional) Defaults to 'publicURL'.
# [*neutron_endpoint_type*]
# (optional) Defaults to 'publicURL'.
#
class iaas::resources::auth_file(
$admin_password,
$controller_node = '127.0.0.1',
$keystone_admin_token = undef,
$admin_user = 'admin',
$admin_tenant = 'pippo',
$region_name = 'RegionOne',
$use_no_cache = true,
$cinder_endpoint_type = 'publicURL',
$glance_endpoint_type = 'publicURL',
$keystone_endpoint_type = 'publicURL',
$nova_endpoint_type = 'publicURL',
$neutron_endpoint_type = 'publicURL',
) {
file { '/root/openrc':
owner => 'root',
group => 'root',
mode => '0550',
content => template("${module_name}/openrc.erb")
}
}
......@@ -11,10 +11,12 @@ $zookeeper_id = undef,
class { 'iaas::profile::cinder': } ->
class { 'iaas::profile::nova::controller': } ->
class { 'iaas::profile::neutron::server': } ->
# class { 'iaas::profile::neutron::router': } ->
class { 'iaas::profile::ceilometer::controller':
zookeeper_id => $zookeeper_id
} ->
class { 'iaas::profile::heat': } ->
class { 'iaas::profile::horizon': } ->
class { 'iaas::setup::sharednetwork': }
class { 'iaas::setup::sharednetwork': } ->
class { 'iaas::profile::auth_file': }
}
#!/bin/sh
<% if @keystone_admin_token -%>
export OS_SERVICE_TOKEN='<%= @keystone_admin_token.gsub(/'/){ %q(\') } %>'
export OS_SERVICE_ENDPOINT='http://<%= @controller_node %>:35357/v2.0/'
<% end -%>
export OS_NO_CACHE='<%= @use_no_cache %>'
export OS_TENANT_NAME='<%= @admin_tenant %>'
export OS_USERNAME='<%= @admin_user %>'
export OS_PASSWORD='<%= @admin_password.gsub(/'/){ %q(\') } %>'
export OS_AUTH_URL='http://<%= @controller_node %>:5000/v2.0/'
export OS_AUTH_STRATEGY='keystone'
export OS_REGION_NAME='<%= @region_name %>'
export CINDER_ENDPOINT_TYPE='<%= @cinder_endpoint_type %>'
export GLANCE_ENDPOINT_TYPE='<%= @glance_endpoint_type %>'
export KEYSTONE_ENDPOINT_TYPE='<%= @keystone_endpoint_type %>'
export NOVA_ENDPOINT_TYPE='<%= @nova_endpoint_type %>'
export NEUTRON_ENDPOINT_TYPE='<%= @neutron_endpoint_type %>'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment