Browse Source

Chef 16 fixes

Depends-On: https://review.opendev.org/747602
Depends-On: https://review.opendev.org/747557
Change-Id: I73514e34628dbf61a35f6e0ad19191cdeb2b6451
Signed-off-by: Lance Albertson <lance@osuosl.org>
changes/03/747603/3
Lance Albertson 8 months ago
parent
commit
d645ef3f5e
5 changed files with 8 additions and 24 deletions
  1. +1
    -1
      README.rst
  2. +1
    -3
      recipes/identity_registration.rb
  3. +2
    -14
      recipes/libvirt.rb
  4. +2
    -4
      recipes/nova-common.rb
  5. +2
    -2
      recipes/placement_api.rb

+ 1
- 1
README.rst View File

@ -21,7 +21,7 @@ Requirements
============
- Chef 15 or higher
- Chef Workstation 0.18.3 for testing (also includes Berkshelf for
- Chef Workstation 20.8.111 for testing (also includes Berkshelf for
cookbook dependency resolution)
Platform


+ 1
- 3
recipes/identity_registration.rb View File

@ -20,8 +20,6 @@
# limitations under the License.
#
require 'uri'
class ::Chef::Recipe
include ::Openstack
end
@ -35,7 +33,7 @@ placement_interfaces = {
public: { url: public_endpoint('placement-api') },
internal: { url: internal_endpoint('placement-api') },
}
auth_url = ::URI.decode identity_endpoint.to_s
auth_url = identity_endpoint.to_s
service_pass = get_password 'service', 'openstack-compute'
service_user = node['openstack']['compute']['conf']['keystone_authtoken']['username']
placement_service_pass = get_password 'service', 'openstack-placement'


+ 2
- 14
recipes/libvirt.rb View File

@ -55,22 +55,10 @@ def update_grub_default_kernel(flavor = 'default')
# change default option for /boot/grub/menu.lst
unless current_default.eql?(default_boot)
::Chef::Log.info("Changed grub default to #{default_boot}")
Mixlib::ShellOut.new("sed -i -e 's;^default.*;default #{default_boot};' /boot/grub/menu.lst").run_command
shell_out("sed -i -e 's;^default.*;default #{default_boot};' /boot/grub/menu.lst")
end
end
# def update_grub2_default_kernel(flavor = 'default')
# boot_entry = "'openSUSE GNU/Linux, with Xen hypervisor'"
# begin
# Mixlib::ShellOut.new("grub2-set-default #{boot_entry}").run_command.error!
# ::Chef::Log.info("Changed grub2 default to #{boot_entry}")
# rescue Mixlib::ShellOut::ShellCommandFailed => e
# ::Chef::Application.fatal!(
# "Unable to change grub2 default to #{boot_entry}
# #{e.message}")
# end
# end
def update_boot_kernel_and_trigger_reboot(flavor = 'default')
# only default and xen flavor is supported by this helper right now
if File.exist?('/boot/grub/menu.lst')
@ -85,7 +73,7 @@ def update_boot_kernel_and_trigger_reboot(flavor = 'default')
# trigger reboot through reboot_handler, if kernel-$flavor is not yet
# running
unless Mixlib::ShellOut.new('uname -r').run_command.stdout.include?(flavor)
unless shell_out('uname -r').stdout.include?(flavor)
node.run_state['reboot'] = true
end
end


+ 2
- 4
recipes/nova-common.rb View File

@ -20,8 +20,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
require 'uri'
# Make Openstack object available in Chef::Recipe
class ::Chef::Recipe
include ::Openstack
@ -118,7 +116,7 @@ image_endpoint = internal_endpoint 'image_api'
Chef::Log.debug("openstack-compute::nova-common:identity_endpoint|#{identity_endpoint}")
Chef::Log.debug("openstack-compute::nova-common:novnc_endpoint|#{novnc_endpoint}")
Chef::Log.debug("openstack-compute::nova-common:compute_api_endpoint|#{::URI.decode compute_api_endpoint.to_s}")
Chef::Log.debug("openstack-compute::nova-common:compute_api_endpoint|#{compute_api_endpoint}")
Chef::Log.debug("openstack-compute::nova-common:network_endpoint|#{network_endpoint}")
Chef::Log.debug("openstack-compute::nova-common:image_endpoint|#{image_endpoint}")
# Chef::Log.debug("openstack-compute::nova-common:ironic_endpoint|#{ironic_endpoint}")
@ -133,7 +131,7 @@ node.default['openstack']['compute']['conf_secrets']
.[]('neutron')['metadata_proxy_shared_secret'] =
get_password 'token', 'neutron_metadata_secret'
auth_url = ::URI.decode identity_endpoint.to_s
auth_url = identity_endpoint.to_s
node.default['openstack']['compute']['conf_secrets']
.[]('keystone_authtoken')['password'] =
get_password 'service', 'openstack-compute'


+ 2
- 2
recipes/placement_api.rb View File

@ -44,7 +44,7 @@ end
db_user = node['openstack']['db']['placement']['username']
db_pass = get_password 'db', 'placement'
identity_endpoint = internal_endpoint 'identity'
auth_url = ::URI.decode identity_endpoint.to_s
auth_url = identity_endpoint.to_s
node.default['openstack']['placement']['conf_secrets']
.[]('placement_database')['connection'] =
@ -64,7 +64,7 @@ end
memcache_servers = memcached_servers.join ','
placement_api_endpoint = internal_endpoint 'placement-api'
Chef::Log.debug("openstack-compute::placement_api:placement_api_endpoint|#{::URI.decode placement_api_endpoint.to_s}")
Chef::Log.debug("openstack-compute::placement_api:placement_api_endpoint|#{placement_api_endpoint}")
node.default['openstack']['placement']['conf'].tap do |conf|
unless memcache_servers.empty?


Loading…
Cancel
Save