diff --git a/Berksfile b/Berksfile index 53046cf..3c879f1 100644 --- a/Berksfile +++ b/Berksfile @@ -2,8 +2,10 @@ source 'https://supermarket.chef.io' metadata -cookbook 'openstack-common', - git: 'https://opendev.org/openstack/cookbook-openstack-common' - -cookbook 'openstackclient', - git: 'https://opendev.org/openstack/cookbook-openstackclient' +%w(-common client).each do |cookbook| + if Dir.exist?("../cookbook-openstack#{cookbook}") + cookbook "openstack#{cookbook}", path: "../cookbook-openstack#{cookbook}" + else + cookbook "openstack#{cookbook}", git: "https://opendev.org/openstack/cookbook-openstack#{cookbook}" + end +end diff --git a/attributes/default.rb b/attributes/default.rb index 95cab8c..5963c17 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -149,8 +149,8 @@ when 'fedora', 'rhel' # :pragma-foodcritic: ~FC024 - won't fix this when 'debian' # platform specific package and service name options default['openstack']['identity']['platform'] = { - 'memcache_python_packages' => ['python-memcache'], - 'keystone_packages' => ['keystone'], + 'memcache_python_packages' => ['python3-memcache'], + 'keystone_packages' => ['libapache2-mod-wsgi-py3', 'python3-keystone', 'keystone'], 'keystone_service' => 'keystone', 'keystone_process_name' => 'keystone-all', 'package_overrides' => '', diff --git a/metadata.rb b/metadata.rb index b3382c2..3544200 100644 --- a/metadata.rb +++ b/metadata.rb @@ -15,6 +15,6 @@ depends 'openstackclient' depends 'apache2', '5.0.1' -issues_url 'https://launchpad.net/openstack-chef' if respond_to?(:issues_url) -source_url 'https://github.com/openstack/cookbook-openstack-identity' if respond_to?(:source_url) -chef_version '>= 12.5' if respond_to?(:chef_version) +issues_url 'https://launchpad.net/openstack-chef' +source_url 'https://opendev.org/openstack/cookbook-openstack-identity' +chef_version '>= 14.0' diff --git a/recipes/server-apache.rb b/recipes/server-apache.rb index 3192fad..e3763c3 100644 --- a/recipes/server-apache.rb +++ b/recipes/server-apache.rb @@ -242,7 +242,15 @@ node.normal['apache']['listen'] = apache_listen.uniq # include the apache2 default recipe and the recipes for mod_wsgi include_recipe 'apache2' -include_recipe 'apache2::mod_wsgi' +# TODO(jh): hardcoded to include py2 mod-wsgi package +# include_recipe 'apache2::mod_wsgi' +case node['platform_family'] +when 'debian' + apache_module 'wsgi' +when 'rhel', 'fedora', 'arch', 'amazon' + include_recipe 'apache2::mod_wsgi' +end + # include the apache2 mod_ssl recipe if ssl is enabled for identity include_recipe 'apache2::mod_ssl' if node['openstack']['identity']['ssl']['enabled'] diff --git a/spec/server-apache_spec.rb b/spec/server-apache_spec.rb index 3806a4e..bbcee83 100644 --- a/spec/server-apache_spec.rb +++ b/spec/server-apache_spec.rb @@ -32,14 +32,15 @@ describe 'openstack-identity::server-apache' do end it 'upgrades mysql python packages' do - expect(chef_run).to upgrade_package('identity cookbook package python-mysqldb') + expect(chef_run).to upgrade_package('identity cookbook package python3-mysqldb') end it 'upgrades memcache python packages' do - expect(chef_run).to upgrade_package('identity cookbook package python-memcache') + expect(chef_run).to upgrade_package('identity cookbook package python3-memcache') end it 'upgrades keystone packages' do + expect(chef_run).to upgrade_package('identity cookbook package python3-keystone') expect(chef_run).to upgrade_package('identity cookbook package keystone') end @@ -284,7 +285,7 @@ describe 'openstack-identity::server-apache' do describe 'apache recipes' do it 'include apache recipes' do expect(chef_run).to include_recipe('apache2') - expect(chef_run).to include_recipe('apache2::mod_wsgi') + expect(chef_run).not_to include_recipe('apache2::mod_wsgi') expect(chef_run).not_to include_recipe('apache2::mod_ssl') end