From 788b3362882b4d3ad3135d95b0f05f2d2d84583d Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Mon, 4 Jan 2016 11:57:07 -0700 Subject: [PATCH] Skip docker resource install with UCA packages This change updates the heat modular task to only attempt to install the heat docker packages when using a package set that provides a standalone package. Currently only the RedHat and Debian based package sets provide a seperate package. The UCA packages do not provide the heat docker templates as a separate package. Change-Id: If66f928f8afdebd3eedad1da9ac9e5c1e23c2101 Related-Blueprint: deploy-with-uca-packages --- .../puppet/osnailyfacter/modular/heat/heat.pp | 17 ++++++++++------- tests/noop/spec/hosts/heat/heat_spec.rb | 19 +++++++++++++++---- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/deployment/puppet/osnailyfacter/modular/heat/heat.pp b/deployment/puppet/osnailyfacter/modular/heat/heat.pp index 744ffdcbfb..44e3a56675 100644 --- a/deployment/puppet/osnailyfacter/modular/heat/heat.pp +++ b/deployment/puppet/osnailyfacter/modular/heat/heat.pp @@ -137,14 +137,17 @@ class heat::docker_resource ( } } -if $::osfamily == 'RedHat' { - $docker_resource_package_name = 'openstack-heat-docker' -} elsif $::osfamily == 'Debian' { - $docker_resource_package_name = 'heat-docker' -} +# TODO(aschultz): ubuntu does not have a heat docker package +if !$::os_package_type or $::os_package_type != 'ubuntu' { + if $::osfamily == 'RedHat' { + $docker_resource_package_name = 'openstack-heat-docker' + } elsif $::osfamily == 'Debian' { + $docker_resource_package_name = 'heat-docker' + } -class { 'heat::docker_resource' : - package_name => $docker_resource_package_name, + class { 'heat::docker_resource' : + package_name => $docker_resource_package_name, + } } $haproxy_stats_url = "http://${service_endpoint}:10000/;csv" diff --git a/tests/noop/spec/hosts/heat/heat_spec.rb b/tests/noop/spec/hosts/heat/heat_spec.rb index deb6f8bf2f..cded109076 100644 --- a/tests/noop/spec/hosts/heat/heat_spec.rb +++ b/tests/noop/spec/hosts/heat/heat_spec.rb @@ -35,10 +35,21 @@ describe manifest do sahara = Noop.hiera_structure('sahara/enabled') it 'should install heat-docker package only after heat-engine' do - should contain_package('heat-docker').with( - 'ensure' => 'installed', - 'require' => 'Package[heat-engine]', - ) + if !facts.has_key?(:os_package_type) or facts[:os_package_type] != 'ubuntu' + if facts[:osfamily] == 'RedHat' + heat_docker_package_name = 'openstack-heat-docker' + elsif facts[:osfamily] == 'Debian' + heat_docker_package_name = 'heat-docker' + end + should contain_package('heat-docker').with( + 'ensure' => 'installed', + 'name' => heat_docker_package_name, + 'require' => 'Package[heat-engine]') + else + should_not contain_package('heat-docker').with( + 'ensure' => 'installed', + 'require' => 'Package[heat-engine]') + end end it 'should configure default_log_levels' do