3 describe 'glance::keystone::auth' do
5 describe 'with defaults' do
11 it { should contain_keystone_user('glance').with(
16 it { should contain_keystone_user_role('glance@services').with(
21 it { should contain_keystone_service('glance').with(
24 :description => 'Openstack Image Service'
27 it { should contain_keystone_endpoint('RegionOne/glance').with(
29 :public_url => 'http://127.0.0.1:9292',
30 :admin_url => 'http://127.0.0.1:9292',
31 :internal_url => 'http://127.0.0.1:9292'
36 describe 'when auth_type, password, and service_type are overridden' do
40 :auth_name => 'glancey',
41 :password => 'password',
42 :service_type => 'imagey'
46 it { should contain_keystone_user('glancey').with(
48 :password => 'password'
51 it { should contain_keystone_user_role('glancey@services').with(
56 it { should contain_keystone_service('glancey').with(
59 :description => 'Openstack Image Service'
64 describe 'when address, region, port and protocoll are overridden' do
69 :public_address => '10.0.0.1',
70 :admin_address => '10.0.0.2',
71 :internal_address => '10.0.0.3',
73 :region => 'RegionTwo',
74 :public_protocol => 'https',
75 :admin_protocol => 'https',
76 :internal_protocol => 'https'
80 it { should contain_keystone_endpoint('RegionTwo/glance').with(
82 :public_url => 'https://10.0.0.1:9393',
83 :admin_url => 'https://10.0.0.2:9393',
84 :internal_url => 'https://10.0.0.3:9393'
89 describe 'when endpoint is not set' do
93 :configure_endpoint => false,
98 it { should_not contain_keystone_endpoint('RegionOne/glance') }
101 describe 'when disabling user configuration' do
104 :configure_user => false,
109 it { should_not contain_keystone_user('glance') }
111 it { should contain_keystone_user_role('glance@services') }
113 it { should contain_keystone_service('glance').with(
114 :ensure => 'present',
116 :description => 'Openstack Image Service'
120 describe 'when disabling user and user role configuration' do
123 :configure_user => false,
124 :configure_user_role => false,
129 it { should_not contain_keystone_user('glance') }
131 it { should_not contain_keystone_user_role('glance@services') }
133 it { should contain_keystone_service('glance').with(
134 :ensure => 'present',
136 :description => 'Openstack Image Service'
140 describe 'when configuring glance-api and the keystone endpoint' do
141 let :pre_condition do
142 "class { 'glance::api': keystone_password => 'test' }"
146 { :osfamily => 'Debian' }
152 :configure_endpoint => true
156 it { should contain_keystone_endpoint('RegionOne/glance').with_notify('Service[glance-api]') }
159 describe 'when overriding service name' do
163 :service_name => 'glance_service',
168 it { should contain_keystone_user('glance') }
169 it { should contain_keystone_user_role('glance@services') }
170 it { should contain_keystone_service('glance_service') }
171 it { should contain_keystone_endpoint('RegionOne/glance_service') }