madscience 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cheffile +1 -1
- data/Cheffile.lock +12 -12
- data/cookbooks/apt/CHANGELOG.md +25 -0
- data/cookbooks/apt/README.md +4 -7
- data/cookbooks/apt/attributes/default.rb +17 -0
- data/cookbooks/apt/metadata.json +2 -2
- data/cookbooks/apt/metadata.rb +1 -1
- data/cookbooks/apt/providers/repository.rb +62 -9
- data/cookbooks/apt/recipes/default.rb +15 -8
- data/cookbooks/apt/recipes/unattended-upgrades.rb +43 -0
- data/cookbooks/apt/templates/default/20auto-upgrades.erb +2 -0
- data/cookbooks/apt/templates/default/50unattended-upgrades.erb +62 -0
- data/cookbooks/apt/templates/default/unattended-upgrades.seed.erb +1 -0
- data/cookbooks/dmg/CHANGELOG.md +3 -0
- data/cookbooks/dmg/libraries/matchers.rb +24 -0
- data/cookbooks/dmg/metadata.json +1 -1
- data/cookbooks/dmg/metadata.rb +1 -1
- data/cookbooks/vagrant/README.md +4 -2
- data/cookbooks/vagrant/attributes/default.rb +5 -4
- data/cookbooks/vagrant/libraries/helpers.rb +50 -0
- data/cookbooks/vagrant/metadata.rb +1 -1
- data/cookbooks/vagrant/recipes/mac_os_x.rb +16 -0
- data/cookbooks/windows/Berksfile +7 -0
- data/cookbooks/windows/CHANGELOG.md +31 -0
- data/cookbooks/windows/CONTRIBUTING +46 -0
- data/cookbooks/windows/Gemfile +14 -0
- data/cookbooks/windows/LICENSE +201 -0
- data/cookbooks/windows/README.md +51 -6
- data/cookbooks/windows/TODO.md +6 -0
- data/cookbooks/windows/attributes/default.rb +1 -0
- data/cookbooks/windows/chefignore +2 -0
- data/cookbooks/windows/libraries/matchers.rb +18 -3
- data/cookbooks/windows/libraries/registry_helper.rb +10 -3
- data/cookbooks/windows/libraries/version.rb +4 -3
- data/cookbooks/windows/libraries/windows_architecture_helper.rb +1 -0
- data/cookbooks/windows/libraries/windows_helper.rb +15 -1
- data/cookbooks/windows/libraries/windows_package.rb +266 -0
- data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
- data/cookbooks/windows/metadata.json +12 -4
- data/cookbooks/windows/metadata.rb +1 -1
- data/cookbooks/windows/providers/auto_run.rb +2 -1
- data/cookbooks/windows/providers/batch.rb +1 -0
- data/cookbooks/windows/providers/feature_servermanagercmd.rb +17 -3
- data/cookbooks/windows/providers/font.rb +69 -0
- data/cookbooks/windows/providers/pagefile.rb +2 -2
- data/cookbooks/windows/providers/path.rb +21 -4
- data/cookbooks/windows/providers/printer.rb +1 -0
- data/cookbooks/windows/providers/printer_port.rb +1 -0
- data/cookbooks/windows/providers/reboot.rb +2 -0
- data/cookbooks/windows/providers/registry.rb +9 -6
- data/cookbooks/windows/providers/task.rb +44 -5
- data/cookbooks/windows/providers/zipfile.rb +3 -2
- data/cookbooks/windows/recipes/reboot_handler.rb +1 -1
- data/cookbooks/windows/resources/auto_run.rb +1 -1
- data/cookbooks/windows/resources/font.rb +25 -0
- data/cookbooks/windows/resources/path.rb +1 -1
- data/cookbooks/windows/resources/task.rb +3 -3
- data/cookbooks/windows/resources/zipfile.rb +1 -1
- data/cookbooks/yum/CHANGELOG.md +42 -0
- data/cookbooks/yum/README.md +11 -1
- data/cookbooks/yum/attributes/main.rb +0 -1
- data/cookbooks/yum/metadata.json +2 -2
- data/cookbooks/yum/metadata.rb +1 -2
- data/cookbooks/yum/providers/repository.rb +18 -3
- data/cookbooks/yum/recipes/default.rb +6 -14
- data/cookbooks/yum/resources/globalconfig.rb +5 -2
- data/cookbooks/yum/resources/repository.rb +7 -3
- data/cookbooks/yum/templates/default/main.erb +19 -4
- data/cookbooks/yum/templates/default/repo.erb +17 -4
- data/lib/madscience/version.rb +1 -1
- data/site-cookbooks/madscience-vagrant-cookbook/recipes/default.rb +11 -10
- metadata +17 -3
- data/cookbooks/windows/providers/package.rb +0 -252
- data/cookbooks/windows/resources/package.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81e4425e73420a281a85a6554b517afd24321e23
|
4
|
+
data.tar.gz: 21493a885c13714c163d0d0c17de9ab516d9bb96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24a8a1caa82d98c55449ce2a725792bc718694d30c2e9cebc6f6dba8dbc737e3255049ec66da96ac8e898d1b87a66a2e20dcb0bb1134893d8efac8b6a60d9767
|
7
|
+
data.tar.gz: 77beaf5bdede12e9edd3a0e8750e9c7631872d775e1bc754a3fca619021c4b96be3490013c6965810aa0b9a39ee62d64988210d349ccc2cd2f8c2076203ad411
|
data/Cheffile
CHANGED
@@ -4,6 +4,6 @@
|
|
4
4
|
site 'http://community.opscode.com/api/v1'
|
5
5
|
|
6
6
|
cookbook 'vagrant',
|
7
|
-
:git => 'https://github.com/
|
7
|
+
:git => 'https://github.com/noahgibbs/vagrant-cookbook'
|
8
8
|
cookbook 'virtualbox',
|
9
9
|
:git => 'https://github.com/jtimberman/virtualbox-cookbook'
|
data/Cheffile.lock
CHANGED
@@ -1,32 +1,32 @@
|
|
1
1
|
SITE
|
2
2
|
remote: http://community.opscode.com/api/v1
|
3
3
|
specs:
|
4
|
-
apt (2.
|
4
|
+
apt (2.6.0)
|
5
5
|
chef_handler (1.1.6)
|
6
|
-
dmg (2.2.
|
7
|
-
windows (1.
|
6
|
+
dmg (2.2.2)
|
7
|
+
windows (1.36.1)
|
8
8
|
chef_handler (>= 0.0.0)
|
9
|
-
yum (3.
|
9
|
+
yum (3.5.1)
|
10
10
|
|
11
11
|
GIT
|
12
|
-
remote: https://github.com/jtimberman/
|
12
|
+
remote: https://github.com/jtimberman/virtualbox-cookbook
|
13
13
|
ref: master
|
14
|
-
sha:
|
14
|
+
sha: f694fbed1827128f9aa915e07c2a2d5598c0c6f6
|
15
15
|
specs:
|
16
|
-
|
16
|
+
virtualbox (0.7.2)
|
17
|
+
apt (>= 0.0.0)
|
17
18
|
dmg (>= 0.0.0)
|
18
19
|
windows (>= 0.0.0)
|
20
|
+
yum (>= 0.0.0)
|
19
21
|
|
20
22
|
GIT
|
21
|
-
remote: https://github.com/
|
23
|
+
remote: https://github.com/noahgibbs/vagrant-cookbook
|
22
24
|
ref: master
|
23
|
-
sha:
|
25
|
+
sha: e58eec18bbe960e000f3eb17434c1e87428a6ddf
|
24
26
|
specs:
|
25
|
-
|
26
|
-
apt (>= 0.0.0)
|
27
|
+
vagrant (0.2.1)
|
27
28
|
dmg (>= 0.0.0)
|
28
29
|
windows (>= 0.0.0)
|
29
|
-
yum (>= 0.0.0)
|
30
30
|
|
31
31
|
DEPENDENCIES
|
32
32
|
vagrant (>= 0)
|
data/cookbooks/apt/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@ apt Cookbook CHANGELOG
|
|
2
2
|
======================
|
3
3
|
This file is used to list changes made in each version of the apt cookbook.
|
4
4
|
|
5
|
+
v2.6.0 (2014-09-09)
|
6
|
+
-------------------
|
7
|
+
- Always update on first run - check
|
8
|
+
- Adding ppa support for apt_repository
|
9
|
+
|
10
|
+
v2.5.3 (2014-08-14)
|
11
|
+
-------------------
|
12
|
+
- #87 - Improve default settings, account for non-linux platforms
|
13
|
+
|
14
|
+
v2.5.2 (2014-08-14)
|
15
|
+
-------------------
|
16
|
+
- Fully restore fully restore 2.3.10 behaviour
|
17
|
+
|
18
|
+
v2.5.1 (2014-08-14)
|
19
|
+
-------------------
|
20
|
+
- fix breakage introduced in apt 2.5.0
|
21
|
+
|
22
|
+
v2.5.0 (2014-08-12)
|
23
|
+
-------------------
|
24
|
+
- Add unattended-upgrades recipe
|
25
|
+
- Only update the cache for the created repository
|
26
|
+
- Added ChefSpec matchers and default_action for resources
|
27
|
+
- Avoid cloning resource attributes
|
28
|
+
- Minor documentation updates
|
29
|
+
|
5
30
|
v2.4.0 (2014-05-15)
|
6
31
|
-------------------
|
7
32
|
- [COOK-4534]: Add option to update apt cache at compile time
|
data/cookbooks/apt/README.md
CHANGED
@@ -99,14 +99,14 @@ Resources/Providers
|
|
99
99
|
This LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource immediately.
|
100
100
|
|
101
101
|
#### Actions
|
102
|
-
- :add: creates a repository file and builds the repository listing
|
102
|
+
- :add: creates a repository file and builds the repository listing (default)
|
103
103
|
- :remove: removes the repository file
|
104
104
|
|
105
105
|
#### Attribute Parameters
|
106
106
|
- repo_name: name attribute. The name of the channel to discover
|
107
107
|
- uri: the base of the Debian distribution
|
108
108
|
- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
|
109
|
-
- components: package groupings
|
109
|
+
- components: package groupings... when in doubt use `main`
|
110
110
|
- arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.
|
111
111
|
- trusted: treat all packages from this repository as authenticated regardless of signature
|
112
112
|
- deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.
|
@@ -126,15 +126,12 @@ apt_repository 'zenoss' do
|
|
126
126
|
end
|
127
127
|
```
|
128
128
|
|
129
|
-
Add the Nginx PPA,
|
129
|
+
Add the Nginx PPA, autodetect the key and repository url:
|
130
130
|
|
131
131
|
```ruby
|
132
132
|
apt_repository 'nginx-php' do
|
133
|
-
uri '
|
133
|
+
uri 'ppa:nginx/stable'
|
134
134
|
distribution node['lsb']['codename']
|
135
|
-
components ['main']
|
136
|
-
keyserver 'keyserver.ubuntu.com'
|
137
|
-
key 'C300EE8C'
|
138
135
|
end
|
139
136
|
```
|
140
137
|
|
@@ -27,3 +27,20 @@ default['apt']['compile_time_update'] = false
|
|
27
27
|
default['apt']['key_proxy'] = ''
|
28
28
|
default['apt']['cache_bypass'] = {}
|
29
29
|
default['apt']['periodic_update_min_delay'] = 86_400
|
30
|
+
default['apt']['launchpad_api_version'] = '1.0'
|
31
|
+
default['apt']['unattended_upgrades']['enable'] = false
|
32
|
+
default['apt']['unattended_upgrades']['update_package_lists'] = true
|
33
|
+
# this needs a good default
|
34
|
+
codename = node.attribute?('lsb') ? node['lsb']['codename'] : 'notlinux'
|
35
|
+
default['apt']['unattended_upgrades']['allowed_origins'] = [
|
36
|
+
"#{node['platform'].capitalize} #{codename}"
|
37
|
+
]
|
38
|
+
default['apt']['unattended_upgrades']['package_blacklist'] = []
|
39
|
+
default['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] = false
|
40
|
+
default['apt']['unattended_upgrades']['minimal_steps'] = false
|
41
|
+
default['apt']['unattended_upgrades']['install_on_shutdown'] = false
|
42
|
+
default['apt']['unattended_upgrades']['mail'] = nil
|
43
|
+
default['apt']['unattended_upgrades']['mail_only_on_error'] = true
|
44
|
+
default['apt']['unattended_upgrades']['remove_unused_dependencies'] = false
|
45
|
+
default['apt']['unattended_upgrades']['automatic_reboot'] = false
|
46
|
+
default['apt']['unattended_upgrades']['dl_limit'] = nil
|
data/cookbooks/apt/metadata.json
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"name": "apt",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.6.0",
|
4
4
|
"description": "Configures apt and apt services and LWRPs for managing apt repositories and preferences",
|
5
|
-
"long_description": "apt Cookbook\n============\n[![Cookbook Version](http://img.shields.io/cookbook/v/apt.svg)][cookbook]\n[![Build Status](http://img.shields.io/travis/opscode-cookbooks/apt.svg)][travis]\n\n[cookbook]: https://community.opscode.com/cookbooks/apt\n[travis]: http://travis-ci.org/opscode-cookbooks/apt\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date. There are recipes for managing the apt-cacher-ng caching proxy and proxy clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d as well as an LWRP for pinning packages via /etc/apt/preferences.d.\n\n\nRequirements\n------------\n**Version 2.0.0+ of this cookbook requires Chef 11.0.0 or later**. If your Chef version is earlier than 11.0.0, use version 1.10.0 of this cookbook.\n\nVersion 1.8.2 to 1.10.0 of this cookbook requires **Chef 10.16.4** or later.\n\nIf your Chef version is earlier than 10.16.4, use version 1.7.0 of this cookbook.\n\n### Platform\nPlease refer to the [TESTING file](TESTING.md) to see the currently (and passing) tested platforms. The release was tested on:\n\n* Ubuntu 10.04\n* Ubuntu 12.04\n* Ubuntu 13.04\n* Debian 7.1\n* Debian 6.0 (have with manual testing)\n\nMay work with or without modification on other Debian derivatives.\n\n\n-------\n### default\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is more than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\n**Including the default recipe on a node that does not support apt (such as Windows) results in a noop.**\n\n### cacher-client\nConfigures the node to use the `apt-cacher-ng` server as a client.\n\n#### Bypassing the cache\nOccasionally you may come across repositories that do not play nicely when the node is using an `apt-cacher-ng` server. You can configure `cacher-client` to bypass the server and connect directly to the repository with the `cache_bypass` attribute.\n\nTo do this, you need to override the `cache_bypass` attribute with an array of repositories, with each array key as the repository URL and value as the protocol to use:\n\n```json\n{\n ...,\n 'apt': {\n ...,\n 'cache_bypass': {\n URL: PROTOCOL\n }\n }\n}\n```\n\nFor example, to prevent caching and directly connect to the repository at `download.oracle.com` via http:\n\n```json\n{\n 'apt': {\n 'cache_bypass': {\n 'download.oracle.com': 'http'\n }\n }\n}\n```\n\n### cacher-ng\nInstalls the `apt-cacher-ng` package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/acng-report.html.\n\nIf you wish to help the `cacher-ng` recipe seed itself, you must now explicitly include the `cacher-client` recipe in your run list **after** `cacher-ng` or you will block your ability to install any packages (ie. `apt-cacher-ng`).\n\n\nAttributes\n----------\n* `['apt']['cacher_ipaddress']` - use a cacher server (or standard proxy server) not available via search\n* `['apt']['cacher_interface]` - interface to connect to the cacher-ng service, no default.\n* `['apt']['cacher_port']` - port for the cacher-ng service (either client or server), default is '3142'\n* `['apt']['cacher_dir']` - directory used by cacher-ng service, default is '/var/cache/apt-cacher-ng'\n* `['apt']['cacher-client']['restrict_environment']` - restrict your node to using the `apt-cacher-ng` server in your Environment, default is 'false'\n* `['apt']['compiletime']` - force the `cacher-client` recipe to run before other recipes. It forces apt to use the proxy before other recipes run. Useful if your nodes have limited access to public apt repositories. This is overridden if the `cacher-ng` recipe is in your run list. Default is 'false'\n* `['apt']['compile_time_update']` - force the default recipe to run `apt-get update` at compile time.\n* `['apt']['cache_bypass']` - array of URLs to bypass the cache. Accepts the URL and protocol to fetch directly from the remote repository and not attempt to cache\n* `['apt']['periodic_update_min_delay']` - minimum delay (in seconds) beetween two actual executions of `apt-get update` by the `execute[apt-get-update-periodic]` resource, default is '86400' (24 hours)\n\nLibraries\n---------\nThere is an `interface_ipaddress` method that returns the IP address for a particular host and interface, used by the `cacher-client` recipe. To enable it on the server use the `['apt']['cacher_interface']` attribute.\n\nResources/Providers\n-------------------\n### `apt_repository`\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource immediately.\n\n#### Actions\n- :add: creates a repository file and builds the repository listing\n- :remove: removes the repository file\n\n#### Attribute Parameters\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings..when it doubt use `main`\n- arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.\n- trusted: treat all packages from this repository as authenticated regardless of signature\n- deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.\n- keyserver: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `keyserver` is provided, this is assumed to be the fingerprint, otherwise it can be either the URI to the GPG key for the repo, or a cookbook_file.\n- key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG.\n- cookbook: if key should be a cookbook_file, specify a cookbook where the key is located for files/default. Defaults to nil, so it will use the cookbook where the resource is used.\n\n#### Examples\n\nAdd the Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n uri 'http://dev.zenoss.org/deb'\n components ['main', 'stable']\nend\n```\n\nAdd the Nginx PPA, grabbing the key from keyserver:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'http://ppa.launchpad.net/nginx/php5/ubuntu'\n distribution node['lsb']['codename']\n components ['main']\n keyserver 'keyserver.ubuntu.com'\n key 'C300EE8C'\nend\n```\n\nAdd the Nginx PPA, grab the key from the keyserver, and add source repo:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'http://ppa.launchpad.net/nginx/php5/ubuntu'\n distribution node['lsb']['codename']\n components ['main']\n keyserver 'keyserver.ubuntu.com'\n key 'C300EE8C'\n deb_src true\nend\n```\n\nAdd the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64:\n\n```ruby\napt_repository 'cloudera' do\n uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'\n arch 'amd64'\n distribution 'precise-cdh4'\n components ['contrib']\n key 'http://archive.cloudera.com/debian/archive.key'\nend\n```\n\nRemove Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n action :remove\nend\n```\n\n### `apt_preference`\nThis LWRP provides an easy way to pin packages in /etc/apt/preferences.d. Although apt-pinning is quite helpful from time to time please note that Debian does not encourage its use without thorough consideration.\n\nFurther information regarding apt-pinning is available via http://wiki.debian.org/AptPreferences.\n\n#### Actions\n- :add: creates a preferences file under /etc/apt/preferences.d\n- :remove: Removes the file, therefore unpin the package\n\n#### Attribute Parameters\n- package_name: name attribute. The name of the package\n- glob: Pin by glob() expression or regexp surrounded by /.\n- pin: The package version/repository to pin\n- pin_priority: The pinning priority aka \"the highest package version wins\"\n\n#### Examples\nPin libmysqlclient16 to version 5.1.49-3:\n\n```ruby\napt_preference 'libmysqlclient16' do\n pin 'version 5.1.49-3'\n pin_priority '700'\nend\n```\n\nUnpin libmysqlclient16:\n\n```ruby\napt_preference 'libmysqlclient16' do\n action :remove\nend\n```\n\nPin all packages from dotdeb.org:\n\n```ruby\napt_preference 'dotdeb' do\n glob '*'\n pin 'origin packages.dotdeb.org'\n pin_priority '700'\nend\n```\n\n\nUsage\n-----\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n```ruby\ntemplate '/etc/apt/sources.list.d/my_apt_sources.list' do\n notifies :run, 'execute[apt-get update]', :immediately\nend\n```\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher-ng]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nIf you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (joshua@opscode.com)\n- Author:: Matt Ray (matt@opscode.com)\n- Author:: Seth Chisamore (schisamo@opscode.com)\n\n```text\nCopyright 2009-2013, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
|
5
|
+
"long_description": "apt Cookbook\n============\n[![Cookbook Version](http://img.shields.io/cookbook/v/apt.svg)][cookbook]\n[![Build Status](http://img.shields.io/travis/opscode-cookbooks/apt.svg)][travis]\n\n[cookbook]: https://community.opscode.com/cookbooks/apt\n[travis]: http://travis-ci.org/opscode-cookbooks/apt\n\nThis cookbook includes recipes to execute apt-get update to ensure the local APT package cache is up to date. There are recipes for managing the apt-cacher-ng caching proxy and proxy clients. It also includes a LWRP for managing APT repositories in /etc/apt/sources.list.d as well as an LWRP for pinning packages via /etc/apt/preferences.d.\n\n\nRequirements\n------------\n**Version 2.0.0+ of this cookbook requires Chef 11.0.0 or later**. If your Chef version is earlier than 11.0.0, use version 1.10.0 of this cookbook.\n\nVersion 1.8.2 to 1.10.0 of this cookbook requires **Chef 10.16.4** or later.\n\nIf your Chef version is earlier than 10.16.4, use version 1.7.0 of this cookbook.\n\n### Platform\nPlease refer to the [TESTING file](TESTING.md) to see the currently (and passing) tested platforms. The release was tested on:\n\n* Ubuntu 10.04\n* Ubuntu 12.04\n* Ubuntu 13.04\n* Debian 7.1\n* Debian 6.0 (have with manual testing)\n\nMay work with or without modification on other Debian derivatives.\n\n\n-------\n### default\nThis recipe installs the `update-notifier-common` package to provide the timestamp file used to only run `apt-get update` if the cache is more than one day old.\n\nThis recipe should appear first in the run list of Debian or Ubuntu nodes to ensure that the package cache is up to date before managing any `package` resources with Chef.\n\nThis recipe also sets up a local cache directory for preseeding packages.\n\n**Including the default recipe on a node that does not support apt (such as Windows) results in a noop.**\n\n### cacher-client\nConfigures the node to use the `apt-cacher-ng` server as a client.\n\n#### Bypassing the cache\nOccasionally you may come across repositories that do not play nicely when the node is using an `apt-cacher-ng` server. You can configure `cacher-client` to bypass the server and connect directly to the repository with the `cache_bypass` attribute.\n\nTo do this, you need to override the `cache_bypass` attribute with an array of repositories, with each array key as the repository URL and value as the protocol to use:\n\n```json\n{\n ...,\n 'apt': {\n ...,\n 'cache_bypass': {\n URL: PROTOCOL\n }\n }\n}\n```\n\nFor example, to prevent caching and directly connect to the repository at `download.oracle.com` via http:\n\n```json\n{\n 'apt': {\n 'cache_bypass': {\n 'download.oracle.com': 'http'\n }\n }\n}\n```\n\n### cacher-ng\nInstalls the `apt-cacher-ng` package and service so the system can provide APT caching. You can check the usage report at http://{hostname}:3142/acng-report.html.\n\nIf you wish to help the `cacher-ng` recipe seed itself, you must now explicitly include the `cacher-client` recipe in your run list **after** `cacher-ng` or you will block your ability to install any packages (ie. `apt-cacher-ng`).\n\n\nAttributes\n----------\n* `['apt']['cacher_ipaddress']` - use a cacher server (or standard proxy server) not available via search\n* `['apt']['cacher_interface]` - interface to connect to the cacher-ng service, no default.\n* `['apt']['cacher_port']` - port for the cacher-ng service (either client or server), default is '3142'\n* `['apt']['cacher_dir']` - directory used by cacher-ng service, default is '/var/cache/apt-cacher-ng'\n* `['apt']['cacher-client']['restrict_environment']` - restrict your node to using the `apt-cacher-ng` server in your Environment, default is 'false'\n* `['apt']['compiletime']` - force the `cacher-client` recipe to run before other recipes. It forces apt to use the proxy before other recipes run. Useful if your nodes have limited access to public apt repositories. This is overridden if the `cacher-ng` recipe is in your run list. Default is 'false'\n* `['apt']['compile_time_update']` - force the default recipe to run `apt-get update` at compile time.\n* `['apt']['cache_bypass']` - array of URLs to bypass the cache. Accepts the URL and protocol to fetch directly from the remote repository and not attempt to cache\n* `['apt']['periodic_update_min_delay']` - minimum delay (in seconds) beetween two actual executions of `apt-get update` by the `execute[apt-get-update-periodic]` resource, default is '86400' (24 hours)\n\nLibraries\n---------\nThere is an `interface_ipaddress` method that returns the IP address for a particular host and interface, used by the `cacher-client` recipe. To enable it on the server use the `['apt']['cacher_interface']` attribute.\n\nResources/Providers\n-------------------\n### `apt_repository`\nThis LWRP provides an easy way to manage additional APT repositories. Adding a new repository will notify running the `execute[apt-get-update]` resource immediately.\n\n#### Actions\n- :add: creates a repository file and builds the repository listing (default)\n- :remove: removes the repository file\n\n#### Attribute Parameters\n- repo_name: name attribute. The name of the channel to discover\n- uri: the base of the Debian distribution\n- distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`\n- components: package groupings... when in doubt use `main`\n- arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.\n- trusted: treat all packages from this repository as authenticated regardless of signature\n- deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.\n- keyserver: the GPG keyserver where the key for the repo should be retrieved\n- key: if a `keyserver` is provided, this is assumed to be the fingerprint, otherwise it can be either the URI to the GPG key for the repo, or a cookbook_file.\n- key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG.\n- cookbook: if key should be a cookbook_file, specify a cookbook where the key is located for files/default. Defaults to nil, so it will use the cookbook where the resource is used.\n\n#### Examples\n\nAdd the Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n uri 'http://dev.zenoss.org/deb'\n components ['main', 'stable']\nend\n```\n\nAdd the Nginx PPA, autodetect the key and repository url:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'ppa:nginx/stable'\n distribution node['lsb']['codename']\nend\n```\n\nAdd the Nginx PPA, grab the key from the keyserver, and add source repo:\n\n```ruby\napt_repository 'nginx-php' do\n uri 'http://ppa.launchpad.net/nginx/php5/ubuntu'\n distribution node['lsb']['codename']\n components ['main']\n keyserver 'keyserver.ubuntu.com'\n key 'C300EE8C'\n deb_src true\nend\n```\n\nAdd the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64:\n\n```ruby\napt_repository 'cloudera' do\n uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'\n arch 'amd64'\n distribution 'precise-cdh4'\n components ['contrib']\n key 'http://archive.cloudera.com/debian/archive.key'\nend\n```\n\nRemove Zenoss repo:\n\n```ruby\napt_repository 'zenoss' do\n action :remove\nend\n```\n\n### `apt_preference`\nThis LWRP provides an easy way to pin packages in /etc/apt/preferences.d. Although apt-pinning is quite helpful from time to time please note that Debian does not encourage its use without thorough consideration.\n\nFurther information regarding apt-pinning is available via http://wiki.debian.org/AptPreferences.\n\n#### Actions\n- :add: creates a preferences file under /etc/apt/preferences.d\n- :remove: Removes the file, therefore unpin the package\n\n#### Attribute Parameters\n- package_name: name attribute. The name of the package\n- glob: Pin by glob() expression or regexp surrounded by /.\n- pin: The package version/repository to pin\n- pin_priority: The pinning priority aka \"the highest package version wins\"\n\n#### Examples\nPin libmysqlclient16 to version 5.1.49-3:\n\n```ruby\napt_preference 'libmysqlclient16' do\n pin 'version 5.1.49-3'\n pin_priority '700'\nend\n```\n\nUnpin libmysqlclient16:\n\n```ruby\napt_preference 'libmysqlclient16' do\n action :remove\nend\n```\n\nPin all packages from dotdeb.org:\n\n```ruby\napt_preference 'dotdeb' do\n glob '*'\n pin 'origin packages.dotdeb.org'\n pin_priority '700'\nend\n```\n\n\nUsage\n-----\nPut `recipe[apt]` first in the run list. If you have other recipes that you want to use to configure how apt behaves, like new sources, notify the execute resource to run, e.g.:\n\n```ruby\ntemplate '/etc/apt/sources.list.d/my_apt_sources.list' do\n notifies :run, 'execute[apt-get update]', :immediately\nend\n```\n\nThe above will run during execution phase since it is a normal template resource, and should appear before other package resources that need the sources in the template.\n\nPut `recipe[apt::cacher-ng]` in the run_list for a server to provide APT caching and add `recipe[apt::cacher-client]` on the rest of the Debian-based nodes to take advantage of the caching server.\n\nIf you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (joshua@opscode.com)\n- Author:: Matt Ray (matt@opscode.com)\n- Author:: Seth Chisamore (schisamo@opscode.com)\n\n```text\nCopyright 2009-2013, Opscode, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
|
6
6
|
"maintainer": "Chef Software, Inc.",
|
7
7
|
"maintainer_email": "cookbooks@opscode.com",
|
8
8
|
"license": "Apache 2.0",
|
data/cookbooks/apt/metadata.rb
CHANGED
@@ -4,7 +4,7 @@ maintainer_email 'cookbooks@opscode.com'
|
|
4
4
|
license 'Apache 2.0'
|
5
5
|
description 'Configures apt and apt services and LWRPs for managing apt repositories and preferences'
|
6
6
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
7
|
-
version '2.
|
7
|
+
version '2.6.0'
|
8
8
|
recipe 'apt', 'Runs apt-get update during compile phase and sets up preseed directories'
|
9
9
|
recipe 'apt::cacher-ng', 'Set up an apt-cacher-ng caching proxy'
|
10
10
|
recipe 'apt::cacher-client', 'Client for the apt::cacher-ng caching proxy'
|
@@ -95,6 +95,47 @@ def build_repo(uri, distribution, components, trusted, arch, add_deb_src)
|
|
95
95
|
repo
|
96
96
|
end
|
97
97
|
|
98
|
+
def get_ppa_key(ppa_owner, ppa_repo)
|
99
|
+
# Launchpad has currently only one stable API which is marked as EOL April 2015.
|
100
|
+
# The new api in devel still uses the same api call for +archive, so I made the version
|
101
|
+
# configurable to provide some sort of workaround if api 1.0 ceases to exist.
|
102
|
+
# See https://launchpad.net/+apidoc/
|
103
|
+
launchpad_ppa_api = "https://launchpad.net/api/#{node['apt']['launchpad_api_version']}/~%s/+archive/%s"
|
104
|
+
default_keyserver = 'keyserver.ubuntu.com'
|
105
|
+
|
106
|
+
require 'open-uri'
|
107
|
+
api_query = sprintf("#{launchpad_ppa_api}/signing_key_fingerprint", ppa_owner, ppa_repo)
|
108
|
+
begin
|
109
|
+
key_id = open(api_query).read.delete('"')
|
110
|
+
rescue OpenURI::HTTPError => e
|
111
|
+
error = 'Could not access launchpad ppa key api: HttpError: ' + e.message
|
112
|
+
raise error
|
113
|
+
rescue SocketError => e
|
114
|
+
error = 'Could not access launchpad ppa key api: SocketError: ' + e.message
|
115
|
+
raise error
|
116
|
+
end
|
117
|
+
|
118
|
+
install_key_from_keyserver(key_id, default_keyserver)
|
119
|
+
end
|
120
|
+
|
121
|
+
# fetch ppa key, return full repo url
|
122
|
+
def get_ppa_url(ppa)
|
123
|
+
repo_schema = 'http://ppa.launchpad.net/%s/%s/ubuntu'
|
124
|
+
|
125
|
+
# ppa:user/repo logic ported from
|
126
|
+
# http://bazaar.launchpad.net/~ubuntu-core-dev/software-properties/main/view/head:/softwareproperties/ppa.py#L86
|
127
|
+
return false unless ppa.start_with?('ppa:')
|
128
|
+
|
129
|
+
ppa_name = ppa.split(':')[1]
|
130
|
+
ppa_owner = ppa_name.split('/')[0]
|
131
|
+
ppa_repo = ppa_name.split('/')[1]
|
132
|
+
ppa_repo = 'ppa' if ppa_repo.nil?
|
133
|
+
|
134
|
+
get_ppa_key(ppa_owner, ppa_repo)
|
135
|
+
|
136
|
+
sprintf(repo_schema, ppa_owner, ppa_repo)
|
137
|
+
end
|
138
|
+
|
98
139
|
action :add do
|
99
140
|
# add key
|
100
141
|
if new_resource.keyserver && new_resource.key
|
@@ -119,15 +160,27 @@ action :add do
|
|
119
160
|
notifies :run, 'execute[apt-cache gencaches]', :immediately
|
120
161
|
end
|
121
162
|
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
163
|
+
if new_resource.uri.start_with?('ppa:')
|
164
|
+
# build ppa repo file
|
165
|
+
repository = build_repo(
|
166
|
+
get_ppa_url(new_resource.uri),
|
167
|
+
new_resource.distribution,
|
168
|
+
'main',
|
169
|
+
new_resource.trusted,
|
170
|
+
new_resource.arch,
|
171
|
+
new_resource.deb_src
|
172
|
+
)
|
173
|
+
else
|
174
|
+
# build repo file
|
175
|
+
repository = build_repo(
|
176
|
+
new_resource.uri,
|
177
|
+
new_resource.distribution,
|
178
|
+
new_resource.components,
|
179
|
+
new_resource.trusted,
|
180
|
+
new_resource.arch,
|
181
|
+
new_resource.deb_src
|
182
|
+
)
|
183
|
+
end
|
131
184
|
|
132
185
|
file "/etc/apt/sources.list.d/#{new_resource.name}.list" do
|
133
186
|
owner 'root'
|
@@ -25,21 +25,28 @@
|
|
25
25
|
|
26
26
|
Chef::Log.debug 'apt is not installed. Apt-specific resources will not be executed.' unless apt_installed?
|
27
27
|
|
28
|
+
first_run_file = File.join(Chef::Config[:file_cache_path], "apt_compile_time_update_first_run")
|
29
|
+
|
28
30
|
# If compile_time_update run apt-get update at compile time
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
if node['apt']['compile_time_update'] && ( !::File.exist?('/var/lib/apt/periodic/update-success-stamp') || !::File.exist?(first_run_file) )
|
32
|
+
e = bash 'apt-get-update at compile time' do
|
33
|
+
code <<-EOH
|
34
|
+
apt-get update
|
35
|
+
touch #{first_run_file}
|
36
|
+
EOH
|
37
|
+
ignore_failure true
|
38
|
+
only_if { apt_installed? }
|
39
|
+
action :nothing
|
40
|
+
end
|
41
|
+
e.run_action(:run)
|
34
42
|
end
|
35
|
-
e.run_action(:run) if node['apt']['compile_time_update']
|
36
43
|
|
37
44
|
# Run apt-get update to create the stamp file
|
38
45
|
execute 'apt-get-update' do
|
39
46
|
command 'apt-get update'
|
40
47
|
ignore_failure true
|
41
48
|
only_if { apt_installed? }
|
42
|
-
not_if { ::File.
|
49
|
+
not_if { ::File.exist?('/var/lib/apt/periodic/update-success-stamp') }
|
43
50
|
end
|
44
51
|
|
45
52
|
# For other recipes to call to force an update
|
@@ -75,7 +82,7 @@ execute 'apt-get-update-periodic' do
|
|
75
82
|
ignore_failure true
|
76
83
|
only_if do
|
77
84
|
apt_installed? &&
|
78
|
-
::File.
|
85
|
+
::File.exist?('/var/lib/apt/periodic/update-success-stamp') &&
|
79
86
|
::File.mtime('/var/lib/apt/periodic/update-success-stamp') < Time.now - node['apt']['periodic_update_min_delay']
|
80
87
|
end
|
81
88
|
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
#
|
2
|
+
# Cookbook Name:: apt
|
3
|
+
# Recipe:: unattended-upgrades
|
4
|
+
#
|
5
|
+
# Copyright 2014, Opscode, Inc.
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the 'License');
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an 'AS IS' BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
# On systems where apt is not installed, the resources in this recipe are not
|
21
|
+
# executed. However, they _must_ still be present in the resource collection
|
22
|
+
# or other cookbooks which notify these resources will fail on non-apt-enabled
|
23
|
+
# systems.
|
24
|
+
#
|
25
|
+
|
26
|
+
package 'unattended-upgrades' do
|
27
|
+
response_file 'unattended-upgrades.seed.erb'
|
28
|
+
action :install
|
29
|
+
end
|
30
|
+
|
31
|
+
template '/etc/apt/apt.conf.d/20auto-upgrades' do
|
32
|
+
owner 'root'
|
33
|
+
group 'root'
|
34
|
+
mode '644'
|
35
|
+
source '20auto-upgrades.erb'
|
36
|
+
end
|
37
|
+
|
38
|
+
template '/etc/apt/apt.conf.d/50unattended-upgrades' do
|
39
|
+
owner 'root'
|
40
|
+
group 'root'
|
41
|
+
mode '644'
|
42
|
+
source '50unattended-upgrades.erb'
|
43
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
// Automatically upgrade packages from these (origin:archive) pairs
|
2
|
+
Unattended-Upgrade::Allowed-Origins {
|
3
|
+
<% unless node['apt']['unattended_upgrades']['allowed_origins'].empty? -%>
|
4
|
+
<% node['apt']['unattended_upgrades']['allowed_origins'].each do |origin| -%>
|
5
|
+
"<%= origin %>";
|
6
|
+
<% end -%>
|
7
|
+
<% end -%>
|
8
|
+
};
|
9
|
+
|
10
|
+
|
11
|
+
// List of packages to not update
|
12
|
+
Unattended-Upgrade::Package-Blacklist {
|
13
|
+
<% unless node['apt']['unattended_upgrades']['package_blacklist'].empty? -%>
|
14
|
+
<% node['apt']['unattended_upgrades']['package_blacklist'].each do |package| -%>
|
15
|
+
"<%= package %>";
|
16
|
+
<% end -%>
|
17
|
+
<% end -%>
|
18
|
+
};
|
19
|
+
|
20
|
+
// This option allows you to control if on a unclean dpkg exit
|
21
|
+
// unattended-upgrades will automatically run
|
22
|
+
// dpkg --force-confold --configure -a
|
23
|
+
// The default is true, to ensure updates keep getting installed
|
24
|
+
Unattended-Upgrade::AutoFixInterruptedDpkg "<%= node['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg'] ? 'true' : 'false' %>";
|
25
|
+
|
26
|
+
// Split the upgrade into the smallest possible chunks so that
|
27
|
+
// they can be interrupted with SIGUSR1. This makes the upgrade
|
28
|
+
// a bit slower but it has the benefit that shutdown while a upgrade
|
29
|
+
// is running is possible (with a small delay)
|
30
|
+
Unattended-Upgrade::MinimalSteps "<%= node['apt']['unattended_upgrades']['minimal_steps'] ? 'true' : 'false' %>";
|
31
|
+
|
32
|
+
// Install all unattended-upgrades when the machine is shuting down
|
33
|
+
// instead of doing it in the background while the machine is running
|
34
|
+
// This will (obviously) make shutdown slower
|
35
|
+
Unattended-Upgrade::InstallOnShutdown "<%= node['apt']['unattended_upgrades']['install_on_shutdown'] ? 'true' : 'false' %>";
|
36
|
+
|
37
|
+
// Send email to this address for problems or packages upgrades
|
38
|
+
// If empty or unset then no email is sent, make sure that you
|
39
|
+
// have a working mail setup on your system. A package that provides
|
40
|
+
// 'mailx' must be installed.
|
41
|
+
<% if node['apt']['unattended_upgrades']['mail'] -%>
|
42
|
+
Unattended-Upgrade::Mail "<%= node['apt']['unattended_upgrades']['mail'] %>";
|
43
|
+
<% end -%>
|
44
|
+
|
45
|
+
// Set this value to "true" to get emails only on errors. Default
|
46
|
+
// is to always send a mail if Unattended-Upgrade::Mail is set
|
47
|
+
Unattended-Upgrade::MailOnlyOnError "<%= node['apt']['unattended_upgrades']['mail_only_on_error'] ? 'true' : 'false' %>";
|
48
|
+
|
49
|
+
// Do automatic removal of new unused dependencies after the upgrade
|
50
|
+
// (equivalent to apt-get autoremove)
|
51
|
+
Unattended-Upgrade::Remove-Unused-Dependencies "<%= node['apt']['unattended_upgrades']['remove_unused_dependencies'] ? 'true' : 'false' %>";
|
52
|
+
|
53
|
+
// Automatically reboot *WITHOUT CONFIRMATION* if a
|
54
|
+
// the file /var/run/reboot-required is found after the upgrade
|
55
|
+
Unattended-Upgrade::Automatic-Reboot "<%= node['apt']['unattended_upgrades']['automatic_reboot'] ? 'true' : 'false' %>";
|
56
|
+
|
57
|
+
|
58
|
+
// Use apt bandwidth limit feature, this example limits the download
|
59
|
+
// speed to 70kb/sec
|
60
|
+
<% if node['apt']['unattended_upgrades']['dl_limit'] -%>
|
61
|
+
Acquire::http::Dl-Limit "<%= node['apt']['unattended_upgrades']['dl_limit'] %>";
|
62
|
+
<% end -%>
|
@@ -0,0 +1 @@
|
|
1
|
+
unattended-upgrades unattended-upgrades/enable_auto_updates boolean <%= node['apt']['unattended_upgrades']['enable'] ? 'true' : 'false' %>
|
data/cookbooks/dmg/CHANGELOG.md
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
# Encoding: utf-8
|
2
|
+
# Cookbook Name:: dmg
|
3
|
+
# Library:: matchers
|
4
|
+
#
|
5
|
+
# Copyright 2014, Fletcher Nichol <fnichol@nichol.ca>
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
if defined?(ChefSpec)
|
21
|
+
def install_dmg_package(app)
|
22
|
+
ChefSpec::Matchers::ResourceMatcher.new(:dmg_package, :install, app)
|
23
|
+
end
|
24
|
+
end
|
data/cookbooks/dmg/metadata.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "dmg",
|
3
|
-
"version": "2.2.
|
3
|
+
"version": "2.2.2",
|
4
4
|
"description": "LWRP to install OS X applications from dmgs",
|
5
5
|
"long_description": "dmg Cookbook\n============\nLightweight resource and provider to install OS X applications (.app) from dmg files.\n\n\nRequirements\n------------\n### Platform\n- Mac OS X\n\n\nResources/Providers\n-------------------\n### dmg_package\n\nThis resource will install a DMG \"Package\". It will retrieve the DMG from a remote URL, mount it using OS X's `hdid`, copy the application (.app directory) to the specified destination (/Applications), and detach the image using `hdiutil`. The dmg file will be stored in the `Chef::Config[:file_cache_path]`. If you want to install an application that has already been downloaded (not using the `source` parameter), copy it to the appropriate location. You can find out what directory this is with the following command on the node to run chef:\n\n```bash\nknife exec -E 'p Chef::Config[:file_cache_path]' -c /etc/chef/client.rb\n```\n\nOptionally, the LWRP can install an \"mpkg\" or \"pkg\" package using installer(8).\n\n#### Actions\n- :install - Installs the application.\n\n#### Parameter attributes:\n- `app` - This is the name of the application used by default for the /Volumes directory and the .app directory copied to /Applications.\n- `source` - remote URL for the dmg to download if specified. Default is nil.\n- `owner` - owner that should own the package installation.\n- `destination` - directory to copy the .app into. Default is /Applications.\n- `checksum` - sha256 checksum of the dmg to download. Default is nil.\n- `type` - type of package, \"app\", \"pkg\" or \"mpkg\". Default is \"app\". When using \"pkg\" or \"mpkg\", the destination must be /Applications.\n- `volumes_dir` - Directory under /Volumes where the dmg is mounted. Not all dmgs are mounted into a /Volumes location matching the name of the dmg. If not specified, this will use the name attribute.\n- `package_id` - Package id registered with pkgutil when a pkg or mpkg is installed\n- `dmg_name` - Specify the name of the dmg if it is not the same as `app`, or if the name has spaces.\n- `dmg_passphrase` - Specify a passphrase to use to unencrypt the dmg while mounting.\n- `accept_eula` - Specify whether to accept the EULA. Certain dmgs require acceptance of EULA before mounting. Can be true or false, defaults to false.\n\n#### Examples\nInstall `/Applications/Tunnelblick.app` from the primary download site.\n\n```ruby\ndmg_package 'Tunnelblick' do\n source 'http://tunnelblick.googlecode.com/files/Tunnelblick_3.1.2.dmg'\n checksum 'a3fae60b6833175f32df20c90cd3a3603a'\n action :install\nend\n```\n\nInstall Google Chrome. Uses the `dmg_name` because the application name has spaces. Installs in `/Applications/Google Chrome.app`.\n\n```ruby\ndmg_package 'Google Chrome' do\n dmg_name 'googlechrome'\n source 'https://dl-ssl.google.com/chrome/mac/stable/GGRM/googlechrome.dmg'\n checksum '7daa2dc5c46d9bfb14f1d7ff4b33884325e5e63e694810adc58f14795165c91a'\n action :install\nend\n```\n\nInstall Dropbox. Uses `volumes_dir` because the mounted directory is different than the name of the application directory. Installs in `/Applications/Dropbox.app`.\n\n```ruby\ndmg_package 'Dropbox' do\n volumes_dir 'Dropbox Installer'\n source 'http://www.dropbox.com/download?plat=mac'\n checksum 'b4ea620ca22b0517b75753283ceb82326aca8bc3c86212fbf725de6446a96a13'\n action :install\nend\n```\n\nInstall MacIrssi to `~/Applications` from the local file downloaded to the cache path into an Applications directory in the current user's home directory. Chef should run as a non-root user for this.\n\n```ruby\ndirectory \"#{ENV['HOME']}/Applications\"\n\ndmg_package 'MacIrssi' do\n destination \"#{ENV['HOME']}/Applications\"\n action :install\nend\n```\n\nInstall Virtualbox to `/Applications` from the .mpkg:\n\n```ruby\ndmg_package 'Virtualbox' do\n source 'http://dlc.sun.com.edgesuite.net/virtualbox/4.0.8/VirtualBox-4.0.8-71778-OSX.dmg'\n type 'mpkg'\nend\n```\n\nInstall pgAdmin to `/Applications` and automatically accept the EULA:\n\n```ruby\ndmg_package 'pgAdmin3' do\n source 'http://wwwmaster.postgresql.org/redir/198/h/pgadmin3/release/v1.12.3/osx/pgadmin3-1.12.3.dmg'\n checksum '9435f79d5b52d0febeddfad392adf82db9df159196f496c1ab139a6957242ce9'\n accept_eula true\nend\n```\n\nInstall Pivotal Tracker to `/Applications` using a password-protected dmg:\n\n```ruby\ndmg_package 'Pivotal Tracker' do\n volumes_dir 'tracker'\n source 'http://cheffiles.pivotallabs.com/fluid_tracker.dmg'\n dmg_passphrase 'xyz'\nend\n```\n\nInstall Silverlight, with idempotence check based on pkgutil:\n\n```ruby\ndmg_package 'Silerlight' do\n source 'http://silverlight.dlservice.microsoft.com/download/D/C/2/DC2D5838-9138-4D25-AA92-52F61F7C51E6/runtime/Silverlight.dmg'\n type 'pkg'\n checksum '6d4a0ad4552d9815531463eb3f467fb8cf4bffcc'\n package_id 'com.microsoft.installSilverlightPlugin'\nend\n```\n\n\nLicense & Authors\n-----------------\n- Author:: Joshua Timberman (joshua@opscode.com)\n\n```text\nCopyright 2011, Joshua Timberman <cookbooks@housepub.org>\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
|
6
6
|
"maintainer": "Opscode, Inc",
|
data/cookbooks/dmg/metadata.rb
CHANGED
data/cookbooks/vagrant/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
vagrant Cookbook
|
2
2
|
================
|
3
3
|
|
4
|
-
Installs Vagrant 1.
|
4
|
+
Installs Vagrant 1.6+ and manages vagrant plugins w/ a custom
|
5
5
|
resource.
|
6
6
|
|
7
7
|
* Vagrant: http://www.vagrantup.com/
|
@@ -9,12 +9,14 @@ resource.
|
|
9
9
|
This cookbook is not intended to be used for vagrant "1.0" (gem
|
10
10
|
install) versions. A recipe is provided for removing the gem, see __Recipes__.
|
11
11
|
|
12
|
+
This cookbook is not supported for installing versions of Vagrant older than 1.6.
|
13
|
+
|
12
14
|
Requirements
|
13
15
|
------------
|
14
16
|
|
15
17
|
Tested with Test Kitchen:
|
16
18
|
|
17
|
-
* Debian 7.
|
19
|
+
* Debian 7.6
|
18
20
|
* Ubuntu 14.04
|
19
21
|
* CentOS 6.5
|
20
22
|
|
@@ -16,7 +16,8 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
default['vagrant']['
|
20
|
-
default['vagrant']['
|
21
|
-
default['vagrant']['
|
22
|
-
default['vagrant']['
|
19
|
+
default['vagrant']['version'] = '1.6.5'
|
20
|
+
default['vagrant']['url'] = vagrant_package_uri(node['vagrant']['version'])
|
21
|
+
default['vagrant']['checksum'] = vagrant_sha256sum(node['vagrant']['version'])
|
22
|
+
default['vagrant']['plugins'] = []
|
23
|
+
default['vagrant']['msi_version'] = ''
|
@@ -0,0 +1,50 @@
|
|
1
|
+
#
|
2
|
+
# Author:: Joshua Timberman <opensource@housepub.org>
|
3
|
+
# Copyright:: Copyright (c) 2014, Joshua Timberman
|
4
|
+
# License:: Apache License, Version 2.0
|
5
|
+
#
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
|
+
# you may not use this file except in compliance with the License.
|
8
|
+
# You may obtain a copy of the License at
|
9
|
+
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
+
#
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
15
|
+
# See the License for the specific language governing permissions and
|
16
|
+
# limitations under the License.
|
17
|
+
#
|
18
|
+
require 'uri'
|
19
|
+
require 'open-uri'
|
20
|
+
|
21
|
+
def vagrant_base_uri
|
22
|
+
'https://dl.bintray.com/mitchellh/vagrant/'
|
23
|
+
end
|
24
|
+
|
25
|
+
def vagrant_platform_package(vers = nil)
|
26
|
+
case node['os']
|
27
|
+
when 'darwin'
|
28
|
+
"vagrant_#{vers}.dmg"
|
29
|
+
when 'windows'
|
30
|
+
"vagrant_#{vers}.msi"
|
31
|
+
when 'linux'
|
32
|
+
case node['platform_family']
|
33
|
+
when 'debian'
|
34
|
+
"vagrant_#{vers}_x86_64.deb"
|
35
|
+
when 'redhat', 'fedora'
|
36
|
+
"vagrant_#{vers}_x86_64.rpm"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def vagrant_sha256sum(vers = nil)
|
42
|
+
# fetch the version-specific sha256sum file
|
43
|
+
# grep for the platform-specific package name
|
44
|
+
sha256sums = open(URI.join(vagrant_base_uri, "#{vers}_SHA256SUMS?direct"))
|
45
|
+
sha256sums.readlines.grep(/#{vagrant_platform_package(vers)}/)[0].split.first
|
46
|
+
end
|
47
|
+
|
48
|
+
def vagrant_package_uri(vers = nil)
|
49
|
+
URI.join(vagrant_base_uri, vagrant_platform_package(vers)).to_s
|
50
|
+
end
|
@@ -4,7 +4,7 @@ maintainer_email 'cookbooks@housepub.org'
|
|
4
4
|
license 'Apache 2.0'
|
5
5
|
description 'Installs/Configures vagrant'
|
6
6
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
7
|
-
version '0.2.
|
7
|
+
version '0.2.1'
|
8
8
|
|
9
9
|
supports 'debian', '>= 6.0'
|
10
10
|
supports 'ubuntu', '>= 12.04'
|