From 0b1ddfe1e62db795692ddf5b489374f0ab0b44e7 Mon Sep 17 00:00:00 2001 From: Mikhail S Medvedev Date: Wed, 14 Dec 2016 10:27:02 -0600 Subject: [PATCH] Make vhd-util optional vhd-util is not always present in default system package repositories. And even custom ppa might not provide the package for all distributions. If vhd-util is not available and we do not care for building vhd images, allow to opt-out from installing the dependency. Change-Id: Icb027b52fdcb790f99e90821974582da0bf6caab --- manifests/init.pp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index da9e16f..5c991bf 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -17,9 +17,22 @@ class diskimage_builder ( $git_source_repo = 'git+https://git.openstack.org/openstack/diskimage-builder', $use_git = false, + $support_vhd = true, ) { include ::pip - include ::apt + + if $support_vhd { + include ::apt + apt::ppa { 'ppa:openstack-ci-core/vhd-util': + } + package { 'vhd-util': + ensure => present, + require => [ + Apt::Ppa['ppa:openstack-ci-core/vhd-util'], + Class['apt::update'], + ], + } + } $packages = [ 'debian-keyring', @@ -28,20 +41,12 @@ class diskimage_builder ( 'python-lzma', 'qemu-utils', 'ubuntu-keyring', - 'vhd-util', 'yum', 'yum-utils', ] - apt::ppa { 'ppa:openstack-ci-core/vhd-util': - } - package { $packages: ensure => present, - require => [ - Apt::Ppa['ppa:openstack-ci-core/vhd-util'], - Class['apt::update'], - ], } # required by the diskimage-builder element scripts