diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3ac9ba1..70fab4b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2017-08-01 10:39:17 -0400 using RuboCop version 0.47.1. +# on 2017-09-01 10:28:48 -0400 using RuboCop version 0.47.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -9,7 +9,7 @@ # Offense count: 20 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: - Max: 408 + Max: 395 # Offense count: 4 # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/metadata.rb b/metadata.rb index a4a2ee3..291c3dc 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,7 +4,7 @@ maintainer_email 'openstack-dev@lists.openstack.org' license 'Apache 2.0' description 'The OpenStack Identity service Keystone.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '15.0.0' +version '15.0.1' %w(ubuntu redhat centos).each do |os| supports os diff --git a/recipes/server-apache.rb b/recipes/server-apache.rb index 49a4615..1f13b5d 100644 --- a/recipes/server-apache.rb +++ b/recipes/server-apache.rb @@ -53,7 +53,10 @@ identity_internal_endpoint = internal_endpoint 'identity' identity_public_endpoint = public_endpoint 'identity' # define the credentials to use for the initial admin user +admin_project = node['openstack']['identity']['admin_project'] +admin_user = node['openstack']['identity']['admin_user'] admin_pass = get_password 'user', node['openstack']['identity']['admin_user'] +admin_role = node['openstack']['identity']['admin_role'] region = node['openstack']['identity']['region'] keystone_user = node['openstack']['identity']['user'] keystone_group = node['openstack']['identity']['group'] @@ -270,9 +273,17 @@ execute 'keystone-manage db_sync' do end # bootstrap keystone after keystone.conf is generated -execute 'keystone bootstrap' do - user 'root' - command "keystone-manage bootstrap --bootstrap-password \"#{admin_pass}\" --bootstrap-region-id \"#{region}\" --bootstrap-admin-url #{identity_admin_endpoint} --bootstrap-public-url #{identity_public_endpoint} --bootstrap-internal-url #{identity_internal_endpoint}" +execute 'bootstrap_keystone' do + command "keystone-manage bootstrap \\ + --bootstrap-password #{admin_pass} \\ + --bootstrap-username #{admin_user} \\ + --bootstrap-project-name #{admin_project} \\ + --bootstrap-role-name #{admin_role} \\ + --bootstrap-service-name keystone \\ + --bootstrap-region-id #{region} \\ + --bootstrap-admin-url #{identity_admin_endpoint} \\ + --bootstrap-public-url #{identity_public_endpoint} \\ + --bootstrap-internal-url #{identity_internal_endpoint}" end #### Start of Apache specific work diff --git a/spec/server-apache_spec.rb b/spec/server-apache_spec.rb index 0c80824..b4c6fe0 100644 --- a/spec/server-apache_spec.rb +++ b/spec/server-apache_spec.rb @@ -14,7 +14,11 @@ describe 'openstack-identity::server-apache' do include Helpers include_context 'identity_stubs' + service_name = 'keystone' + service_user = 'admin' region = 'RegionOne' + project_name = 'admin' + role_name = 'admin' password = 'admin' admin_url = 'http://127.0.0.1:35357/v3' public_url = 'http://127.0.0.1:5000/v3' @@ -47,7 +51,16 @@ describe 'openstack-identity::server-apache' do end it 'bootstrap with keystone-manage' do - expect(chef_run).to run_execute('keystone bootstrap').with(command: "keystone-manage bootstrap --bootstrap-password \"#{password}\" --bootstrap-region-id \"#{region}\" --bootstrap-admin-url #{admin_url} --bootstrap-public-url #{public_url} --bootstrap-internal-url #{internal_url}") + expect(chef_run).to run_execute('bootstrap_keystone').with(command: "keystone-manage bootstrap \\ + --bootstrap-password #{password} \\ + --bootstrap-username #{service_user} \\ + --bootstrap-project-name #{project_name} \\ + --bootstrap-role-name #{role_name} \\ + --bootstrap-service-name #{service_name} \\ + --bootstrap-region-id #{region} \\ + --bootstrap-admin-url #{admin_url} \\ + --bootstrap-public-url #{public_url} \\ + --bootstrap-internal-url #{internal_url}") end describe '/etc/keystone' do