From 7080aaf346cef9baf7a14de16307563997a951c2 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Fri, 23 Oct 2015 22:14:15 +0200 Subject: [PATCH] install nginx repo on debian and ubuntu for integration test --- .../cookbooks/os_prepare/recipes/apt.rb | 20 +++++++++++++++++++ .../cookbooks/os_prepare/recipes/default.rb | 1 + .../cookbooks/os_prepare/recipes/package.rb | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 test/integration/cookbooks/os_prepare/recipes/apt.rb diff --git a/test/integration/cookbooks/os_prepare/recipes/apt.rb b/test/integration/cookbooks/os_prepare/recipes/apt.rb new file mode 100644 index 000000000..8c783e2fc --- /dev/null +++ b/test/integration/cookbooks/os_prepare/recipes/apt.rb @@ -0,0 +1,20 @@ +# encoding: utf-8 +# author: Christoph Hartmann +# author: Dominik Richter + +# add nginx apt repository +case node['platform'] +when 'ubuntu' + include_recipe('apt') + apt_repository 'nginx' do + uri 'ppa:nginx/stable' + distribution node['lsb']['codename'] + end +when 'debian' + include_recipe('apt') + apt_repository 'nginx' do + uri 'http://nginx.org/packages/debian' + distribution node['lsb']['codename'] + components ['nginx'] + end +end diff --git a/test/integration/cookbooks/os_prepare/recipes/default.rb b/test/integration/cookbooks/os_prepare/recipes/default.rb index 316e79549..c524f389e 100644 --- a/test/integration/cookbooks/os_prepare/recipes/default.rb +++ b/test/integration/cookbooks/os_prepare/recipes/default.rb @@ -5,3 +5,4 @@ # prepare all operating systems with the required configuration include_recipe('os_prepare::package') +include_recipe('os_prepare::apt') diff --git a/test/integration/cookbooks/os_prepare/recipes/package.rb b/test/integration/cookbooks/os_prepare/recipes/package.rb index 8d8c03ce7..766034bcf 100644 --- a/test/integration/cookbooks/os_prepare/recipes/package.rb +++ b/test/integration/cookbooks/os_prepare/recipes/package.rb @@ -15,7 +15,7 @@ when 'rhel', 'centos', 'fedora' # TODO: support DNF natively # Special care for fedora 22, since dnf is not officially supported yet # https://github.com/chef/chef/issues/3201 - if node['platform_version'] == 22 + if node['platform_version'] == '22' execute 'dnf install -y yum' end