diff --git a/CHANGELOG.md b/CHANGELOG.md index d2cf320b..6b9b2b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ This file is used to list changes made in each version of the apt cookbook. +## 7.2.0 (2019-08-05) + +- Allow you to specify dpkg options just for unattended upgrades - [@majormoses](https://github.com/majormoses) +- Adding documentation and tests for setting dpkg options unattended upgrades - [@majormoses](https://github.com/majormoses) +- Test on Chef 15 + Chef Workstation - [@tas50](https://github.com/tas50) +- Remove tests of the resources now built into Chef - [@tas50](https://github.com/tas50) +- Remove respond_to from the metadata - [@tas50](https://github.com/tas50) +- Remove the recipe description from the metadata as these aren't used - [@tas50](https://github.com/tas50) +- Replace Chef 12 testing with 13.3 - [@tas50](https://github.com/tas50) +- Remove Ubuntu 14.04 / Debian 8 testing and add Debian 10 testing - [@tas50](https://github.com/tas50) + ## 7.1.1 (2018-10-11) - Allow to customize sender email for unattended-upgrades @@ -26,7 +37,7 @@ This file is used to list changes made in each version of the apt cookbook. ## 6.1.3 (2017-07-19) - Fixed typo in readme -- Fixed config namespace in the 10dpkg-options file +- Fixed config namespace in the 10dpkg-options file ## 6.1.2 (2017-06-20) diff --git a/Gemfile b/Gemfile index c1dbddd8..ee4a8a39 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ # This gemfile provides additional gems for testing and releasing this cookbook -# It is meant to be installed on top of ChefDK which provides the majority +# It is meant to be installed on top of ChefDK / Chef Workstationo which provide the majority # of the necessary gems for testing this cookbook # # Run 'chef exec bundle install' to install these dependencies diff --git a/kitchen.dokken.yml b/kitchen.dokken.yml index 4a3216a1..9cb90ee4 100644 --- a/kitchen.dokken.yml +++ b/kitchen.dokken.yml @@ -2,6 +2,7 @@ driver: name: dokken privileged: true # because Docker and SystemD/Upstart chef_version: <%= ENV['CHEF_VERSION'] || 'current' %> + chef_license: accept-no-persist transport: name: dokken @@ -14,15 +15,19 @@ verifier: name: inspec platforms: -- name: debian-8 +- name: debian-9 driver: - image: dokken/debian-8 + image: debian:9 pid_one_command: /bin/systemd + intermediate_instructions: + - RUN /usr/bin/apt-get update + - RUN /usr/bin/apt-get install -y systemd + - RUN rm /etc/systemd/system/getty.target.wants/getty\@tty1.service -- name: debian-9 +- name: debian-10 driver: # Need a custom Stretch image as dokken one contains extra packages and then we hit https://github.com/chef-cookbooks/apt/issues/234 - image: debian:9 + image: debian:10 pid_one_command: /bin/systemd intermediate_instructions: - RUN /usr/bin/apt-get update diff --git a/kitchen.yml b/kitchen.yml index 18f4e6d4..15b6da16 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -4,21 +4,22 @@ driver: provisioner: name: chef_zero deprecations_as_errors: true + chef_license: accept-no-persist verifier: name: inspec platforms: - name: centos-7 - - name: debian-8 - name: debian-9 + - name: debian-10 - name: ubuntu-16.04 - name: ubuntu-18.04 - - name: ubuntu-16.04-chef-12.9 + - name: ubuntu-16.04-chef-13.3 driver_config: box: bento/ubuntu-16.04 provisioner: - require_chef_omnibus: 12.9.41 + require_chef_omnibus: 13.3 suites: - name: default @@ -38,19 +39,6 @@ suites: compile_time_update: true excludes: centos-7 - - name: resources - run_list: - - recipe[test::resources] - # test that you can specifically modify some unattended upgrades options but leave the majority in place - - recipe[test::unattended-upgrades] - excludes: centos-7 - attributes: - apt: - unattended_upgrades: - dpkg_options: - - --force-confdef - - --force-confold - - name: unattended-upgrades run_list: - recipe[test::unattended-upgrades] diff --git a/metadata.rb b/metadata.rb index f0458449..05fbd219 100644 --- a/metadata.rb +++ b/metadata.rb @@ -4,11 +4,7 @@ license 'Apache-2.0' description 'Configures apt and apt caching.' long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) -version '7.1.1' - -recipe 'apt::default', 'Runs apt-get update during compile phase and sets up preseed directories' -recipe 'apt::cacher-ng', 'Set up an apt-cacher-ng caching proxy' -recipe 'apt::cacher-client', 'Client for the apt::cacher-ng caching proxy' +version '7.2.0' %w(ubuntu debian).each do |os| supports os @@ -16,4 +12,4 @@ source_url 'https://github.com/chef-cookbooks/apt' issues_url 'https://github.com/chef-cookbooks/apt/issues' -chef_version '>= 13.3' if respond_to?(:chef_version) +chef_version '>= 13.3' diff --git a/recipes/unattended-upgrades.rb b/recipes/unattended-upgrades.rb index ee2cb6e8..05c3b89d 100644 --- a/recipes/unattended-upgrades.rb +++ b/recipes/unattended-upgrades.rb @@ -23,7 +23,7 @@ # systems. # -package 'unattended-upgrades' do +package 'unattended-upgrades' do # ~FC009 response_file 'unattended-upgrades.seed.erb' action :install end diff --git a/spec/unit/recipes/default_spec.rb b/spec/unit/recipes/default_spec.rb index 6e8f0248..47252504 100644 --- a/spec/unit/recipes/default_spec.rb +++ b/spec/unit/recipes/default_spec.rb @@ -15,7 +15,7 @@ end it 'installs apt-transport-https, gnupg and dirmngr' do - expect(chef_run).to install_package(['apt-transport-https', 'gnupg', 'dirmngr']) + expect(chef_run).to install_package(%w(apt-transport-https gnupg dirmngr)) end it 'creates preseeding directory' do diff --git a/test/fixtures/cookbooks/test/recipes/resources.rb b/test/fixtures/cookbooks/test/recipes/resources.rb deleted file mode 100644 index dbb27e9f..00000000 --- a/test/fixtures/cookbooks/test/recipes/resources.rb +++ /dev/null @@ -1,121 +0,0 @@ -# -# Cookbook:: test -# Recipe:: resources -# -# Copyright:: 2012-2017, Chef Software, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -include_recipe 'test::base' - -if node['platform'] == 'ubuntu' - # Apt Repository - apt_repository 'juju' do - uri '"http://ppa.launchpad.net/juju/stable/ubuntu"' - components ['main'] - distribution 'trusty' - key 'C8068B11' - keyserver 'keyserver.ubuntu.com' - action :add - end - - # Apt Repository - apt_repository 'nodejs' do - uri 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu' - components ['main'] - distribution 'trusty' - key 'C7917B12' - keyserver 'hkp://keyserver.ubuntu.com:80' - action :add - end - - # PPA Repository w/o key specified - apt_repository 'gimp' do - uri 'ppa:otto-kesselgulasch/gimp' - end - - # Apt repository that suppresses output for sensitive resources. - apt_repository 'haproxy' do - uri 'http://ppa.launchpad.net/vbernat/haproxy-1.5/ubuntu' - components ['main'] - keyserver 'keyserver.ubuntu.com' - key '1C61B9CD' - sensitive true - action :add - end -end - -# Apt Repository with arch -apt_repository 'cloudera' do - uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh' - arch 'amd64' - distribution 'precise-cdh4' - components ['contrib'] - key 'http://archive.cloudera.com/debian/archive.key' - action :add -end - -# Apt repository and install a package it contains -apt_repository 'nginx' do - uri "http://nginx.org/packages/#{node['platform']}" - components ['nginx'] - key 'http://nginx.org/keys/nginx_signing.key' - deb_src true -end - -package 'nginx' do - action :install -end - -# Apt Preferences -apt_preference 'chef' do - pin 'version 12.7.2-1' - pin_priority '700' -end - -# Preference file renaming -file '/etc/apt/preferences.d/wget' do - action :touch -end - -apt_preference 'wget' do - pin 'version 1.13.4-3' - pin_priority '1001' -end - -# COOK-2338 -apt_preference 'dotdeb' do - glob '*' - pin 'origin packages.dotdeb.org ' - pin_priority '700' -end - -# rename preferences with wildcards -file '/etc/apt/preferences.d/*.pref' do - action :touch -end - -apt_preference '*' do - pin 'origin nginx.org' - pin_priority '1001' -end - -# Preference file removal -file '/etc/apt/preferences.d/camel.pref' do - action :touch -end - -apt_preference 'camel' do - action :remove -end