From cad3ddc59c538961cc156a4384f228d1add81018 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Mota Date: Fri, 16 Sep 2016 11:06:14 +0200 Subject: [PATCH] Install required packages for infracloud Current ansible install fails when does not find gcc or openssl-dev. Add this before calling the ansible class. Also remove uuid dependency from RHEL as package does not exist. Change-Id: I1c9002d669ec8df30ef09b3086f9f5297e032da1 --- manifests/bifrost.pp | 9 ++++----- manifests/params.pp | 2 ++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/manifests/bifrost.pp b/manifests/bifrost.pp index 4b2bca4..4969e39 100644 --- a/manifests/bifrost.pp +++ b/manifests/bifrost.pp @@ -22,6 +22,7 @@ class infracloud::bifrost ( $ssh_public_key, $vlan, ) { + include ::infracloud::params # The configdrive bifrost task defaults to copying the user's local public # ssh key. Let's make sure it's there so that bifrost doesn't error and so we @@ -40,8 +41,10 @@ class infracloud::bifrost ( before => Exec['install bifrost'], } + ensure_packages($::infracloud::params::bifrost_req_packages) class { '::ansible': ansible_version => '2.1.1.0', + require => Package[$::infracloud::params::bifrost_req_packages], } class { '::mysql::server': @@ -70,10 +73,6 @@ class infracloud::bifrost ( require => Vcsrepo['/opt/stack/bifrost'], } - package { 'uuid-runtime': - ensure => installed - } - exec { 'install bifrost dependencies': command => 'pip install -U -r /opt/stack/bifrost/requirements.txt', path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin', @@ -118,7 +117,7 @@ class infracloud::bifrost ( Exec['install bifrost dependencies'], File['/etc/bifrost/bifrost_global_vars'], Vcsrepo['/opt/stack/bifrost'], - Package['uuid-runtime'], + Package[$::infracloud::params::bifrost_req_packages], Class['::mysql::server'], ], } diff --git a/manifests/params.pp b/manifests/params.pp index b7defdc..9e15e37 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,10 +4,12 @@ class infracloud::params { 'Debian': { $cert_path = '/usr/local/share/ca-certificates' $cert_command = '/usr/sbin/update-ca-certificates' + $bifrost_req_packages = [ 'gcc', 'libssl-dev', 'uuid-runtime' ] } 'Redhat': { $cert_path = '/etc/pki/ca-trust/source/anchors' $cert_command = '/usr/bin/update-ca-trust' + $bifrost_req_packages = [ 'gcc', 'openssl-devel' ] } default: { fail('Only Debian and RedHat distros are supported.')