From 097e2deedc0e5379d322c292e1960c0b0ba65da9 Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Wed, 13 Feb 2019 17:19:55 -0800 Subject: [PATCH] Don't include the apt recipe over and over again in the recipes We run apt_update once with chef and we already update the cache directly on the container at start. We don't need to try to do the same thing 3 other times. Signed-off-by: Tim Smith --- examples/kitchen-chef/recipes/nginx.rb | 1 - test/cookbooks/os_prepare/recipes/prep_container.rb | 12 +++--------- test/cookbooks/os_prepare/recipes/service.rb | 1 - 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/examples/kitchen-chef/recipes/nginx.rb b/examples/kitchen-chef/recipes/nginx.rb index 71b9f08da..a332d1bc8 100644 --- a/examples/kitchen-chef/recipes/nginx.rb +++ b/examples/kitchen-chef/recipes/nginx.rb @@ -5,7 +5,6 @@ # install repositories for nginx case node['platform'] when 'ubuntu' - include_recipe('apt') # if ubuntu, install apt_repository 'nginx-php' do uri 'ppa:nginx/stable' diff --git a/test/cookbooks/os_prepare/recipes/prep_container.rb b/test/cookbooks/os_prepare/recipes/prep_container.rb index 567bd54c2..43b23bc80 100644 --- a/test/cookbooks/os_prepare/recipes/prep_container.rb +++ b/test/cookbooks/os_prepare/recipes/prep_container.rb @@ -4,12 +4,6 @@ # # prepares container for normal use :-) -# install docker pre-conditions -if ['ubuntu', 'debian'].include?(node['platform']) - include_recipe('apt') - - # if package lsb-release & procps is not installed - # chef returns an empty node['lsb']['codename'] - package("lsb-release") - package("procps") -end +# if package lsb-release & procps is not installed +# chef returns an empty node['lsb']['codename'] +package %w(procps lsb-release) if platform_family?('debian') diff --git a/test/cookbooks/os_prepare/recipes/service.rb b/test/cookbooks/os_prepare/recipes/service.rb index 8ad52dcc4..a24229d0a 100644 --- a/test/cookbooks/os_prepare/recipes/service.rb +++ b/test/cookbooks/os_prepare/recipes/service.rb @@ -7,7 +7,6 @@ case node['platform'] when 'ubuntu' # install ntp as a service - include_recipe 'apt::default' package 'ntp' when 'centos'