cookbook 'apt-periodic', '~> 0.2.0'
apt-periodic (3) Versions 0.2.0 Follow2
Installs/configures apt-periodic and unattended-upgrades
cookbook 'apt-periodic', '~> 0.2.0', :supermarket
knife supermarket install apt-periodic
knife supermarket download apt-periodic
APT::Periodic Cookbook
Chef cookbook for configuring APT::Periodic variables for daily cron job /etc/cron.daily/apt
and unattended-upgrades package on Ubuntu.
/etc/apt/apt.conf.d/10periodic
/etc/apt/apt.conf.d/50unattended-upgrades
Requirements
supports
ubuntu >= 12.04
depends
apt
Installation
From the Community Site
Use the knife command:
$ knife cookbook site install apt-periodic
With librarian-chef
Edit Cheffile
site "https://supermarket.getchef.com/api/v1"
cookbook 'apt-periodic', '~> 0.2.0'
Resolves and installs all of the dependencies:
$ librarian-chef install
With berkshelf
Edit Berksfile
source "https://supermarket.getchef.com"
cookbook 'apt-periodic', '~> 0.2.0'
Install the cookbooks you specified in the Berksfile and their dependencies:
$ berks install
Attributes
apt-periodic::default
See [attributes/default.rb](attributes/default.rb)
<table>
<tr>
<th>Description</th>
<th>Type</th>
<th>Default</th>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['auto_apt_enable']</tt></td>
</tr>
<tr>
<td>Enable the update/upgrade script (0=disable)</td>
<td>String</td>
<td><tt>"1"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['update_interval']</tt></td>
</tr>
<tr>
<td>Do "apt-get update" automatically every n-days (0=disable)</td>
<td>String</td>
<td><tt>"1"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['download_upgradeable_interval']</tt></td>
</tr>
<tr>
<td>Do "apt-get upgrade --download-only" every n-days (0=disable)</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['debdelta']</tt></td>
</tr>
<tr>
<td>Use debdelta-upgrade to download updates if available (0=disable)</td>
<td>String</td>
<td><tt>"1"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['autoclean_interval']</tt></td>
</tr>
<tr>
<td>Do "apt-get autoclean" every n-days (0=disable)</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['backup_level']</tt></td>
</tr>
<tr>
<td>Backup level (0=disable), 1 is invalid.</td>
<td>String</td>
<td><tt>"3"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['backup_archive_interval']</tt></td>
</tr>
<tr>
<td>Backup after n-days if archive contents changed (0=disable)</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['random_sleep']</tt></td>
</tr>
<tr>
<td>Sleep for a random interval of time</td>
<td>String</td>
<td><tt>"1800"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['verbose']</tt></td>
</tr>
<tr>
<td>Set VERBOSE mode from apt-config</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['min_age']</tt></td>
</tr>
<tr>
<td>Set minimum age of a package file. If a file is younger it will not be deleted (0=disable). Usefull to prevent races and to keep backups of the packages for emergency.</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['max_age']</tt></td>
</tr>
<tr>
<td>Set maximum allowed age of a cache package file. If a cache package file is older it is deleted (0=disable)</td>
<td>String</td>
<td><tt>"2"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['max_size']</tt></td>
</tr>
<tr>
<td>Set maximum size of the cache in MB (0=disable). If the cache is bigger, cached package files are deleted until the size requirement is met (the biggest packages will be deleted first).</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrade_interval']</tt></td>
</tr>
<tr>
<td>Run the "unattended-upgrade" security upgrade script every n-days (0=disabled)</td>
<td>String</td>
<td><tt>"0"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['allowed_origins']</tt></td>
</tr>
<tr>
<td>Automatically upgrade packages from these (origin:archive) pairs</td>
<td>Array</td>
<td></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['package_blacklist']</tt></td>
</tr>
<tr>
<td>List of packages to not update</td>
<td>Array</td>
<td><tt>[]</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['auto_fix_interrupted_dpkg']</tt></td>
</tr>
<tr>
<td>This option allows you to control if on a unclean dpkg exit unattended-upgrades will automatically run dpkg --force-confold --configure -a</td>
<td>String</td>
<td><tt>"true"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['minimal_steps']</tt></td>
</tr>
<tr>
<td>Split the upgrade into the smallest possible chunks so that they can be interrupted with SIGUSR1. This makes the upgrade a bit slower but it has the benefit that shutdown while a upgrade is running is possible (with a small delay)</td>
<td>String</td>
<td><tt>"false"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['install_on_shutdown']</tt></td>
</tr>
<tr>
<td>Install all unattended-upgrades when the machine is shuting down instead of doing it in the background while the machine is running. This will (obviously) make shutdown slower</td>
<td>String</td>
<td><tt>"false"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['mail']</tt></td>
</tr>
<tr>
<td>Send email to this address for problems or packages upgrades. If empty or unset then no email is sent, make sure that you have a working mail setup on your system.</td>
<td>String</td>
<td><tt>""</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['mail_only_on_error']</tt></td>
</tr>
<tr>
<td>Set this value to "true" to get emails only on errors.</td>
<td>String</td>
<td><tt>"false"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['remove_unused_dependencies']</tt></td>
</tr>
<tr>
<td>Do automatic removal of new unused dependencies after the upgrade (equivalent to apt-get autoremove)</td>
<td>String</td>
<td><tt>"true"</tt></td>
</tr>
<tr>
<td colspan="3"><tt>['apt_periodic']['unattended_upgrades']['automatic_reboot']</tt></td>
</tr>
<tr>
<td>Automatically reboot WITHOUT CONFIRMATION if a the file /var/run/reboot-required is found after the upgrade</td>
<td>String</td>
<td><tt>"false"</tt></td>
</tr>
</table>
Usage
apt-periodic::default
Just include apt-periodic
in your node's run_list
and override default values if needed.
Example with unattended upgrades every days and notification by mail:
{ "name": "app.crazy-automation.io", "apt_periodic": { "unattended_upgrade_interval": "1", "unattended_upgrades": { "mail": "admin@crazy-automation.io" } }, "run_list": [ "recipe[apt-periodic]" ] }
Development
Dependencies
Installation
Ensure the gem dependencies are installed:
$ bundle install $ bundle exec berks install
Running the tests:
$ bundle exec rspec $ bundle exec kitchen test
Contributing
- Fork the repository on Github
- Create a named feature branch (like
add_component_x
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request using Github
License
Written by Vincent Durand.
Released under the terms of the MIT License. For further information, please see the file [LICENSE.txt](LICENSE.txt).
Dependent cookbooks
apt >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.2.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC064: Ensure issues_url is set in metadata: apt-periodic/metadata.rb:1
FC065: Ensure source_url is set in metadata: apt-periodic/metadata.rb:1
FC066: Ensure chef_version is set in metadata: apt-periodic/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.2.0 failed this metric
FC064: Ensure issues_url is set in metadata: apt-periodic/metadata.rb:1
FC065: Ensure source_url is set in metadata: apt-periodic/metadata.rb:1
FC066: Ensure chef_version is set in metadata: apt-periodic/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
FC065: Ensure source_url is set in metadata: apt-periodic/metadata.rb:1
FC066: Ensure chef_version is set in metadata: apt-periodic/metadata.rb:1
Run with Foodcritic Version 16.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
0.2.0 passed this metric
Testing File Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
0.2.0 failed this metric
0.2.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number