From 76169450bcab8c6ddc1ba90f37475f9160801f73 Mon Sep 17 00:00:00 2001 From: Darren Birkett Date: Fri, 21 Feb 2014 10:41:58 +0000 Subject: [PATCH] add epel repo if adding rdo repo Fixes: bug 1282908 Implements: blueprint centos-rhel-for-common All RDO packages depend on lots of packages from epel. if we have RDO we have to have epel. Change-Id: Ie00b22c77e03a4df6835e1df7523509af8976a35 --- metadata.rb | 1 + recipes/default.rb | 1 + spec/default-redhat_spec.rb | 8 ++++++++ 3 files changed, 10 insertions(+) diff --git a/metadata.rb b/metadata.rb index a86761eb..792c7b10 100644 --- a/metadata.rb +++ b/metadata.rb @@ -18,3 +18,4 @@ end depends 'apt' depends 'database' depends 'yum', '~> 3.0' +depends 'yum-epel' diff --git a/recipes/default.rb b/recipes/default.rb index 0ce628b6..54a5be7d 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -41,6 +41,7 @@ when 'rhel' if node['openstack']['yum']['rdo_enabled'] repo_action = :add + include_recipe 'yum-epel' else repo_action = :remove end diff --git a/spec/default-redhat_spec.rb b/spec/default-redhat_spec.rb index 05aae3d8..4c8af6c0 100644 --- a/spec/default-redhat_spec.rb +++ b/spec/default-redhat_spec.rb @@ -13,6 +13,10 @@ describe 'openstack-common::default' do repo_name = 'RDO-testrelease' expect(@chef_run).to add_yum_repository(repo_name) end + + it 'includes yum-epel recipe' do + expect(@chef_run).to include_recipe('yum-epel') + end end describe 'rhel-no-rdo' do @@ -28,5 +32,9 @@ describe 'openstack-common::default' do repo_name = 'RDO-testrelease' expect(@chef_run).to remove_yum_repository(repo_name) end + + it 'does not include yum-epel recipe' do + expect(@chef_run).to_not include_recipe('yum-epel') + end end end