from-scratch 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/Berksfile.lock +11 -0
  4. data/chefignore +1 -0
  5. data/cookbooks/apt/CHANGELOG.md +248 -0
  6. data/cookbooks/apt/README.md +294 -0
  7. data/cookbooks/apt/attributes/default.rb +51 -0
  8. data/cookbooks/apt/files/default/15update-stamp +1 -0
  9. data/cookbooks/apt/files/default/apt-proxy-v2.conf +50 -0
  10. data/cookbooks/apt/libraries/helpers.rb +61 -0
  11. data/cookbooks/apt/libraries/matchers.rb +17 -0
  12. data/cookbooks/apt/libraries/network.rb +31 -0
  13. data/cookbooks/apt/metadata.json +1 -0
  14. data/cookbooks/apt/providers/preference.rb +84 -0
  15. data/cookbooks/apt/providers/repository.rb +246 -0
  16. data/cookbooks/apt/recipes/cacher-client.rb +83 -0
  17. data/cookbooks/apt/recipes/cacher-ng.rb +43 -0
  18. data/cookbooks/apt/recipes/default.rb +112 -0
  19. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  20. data/cookbooks/apt/resources/preference.rb +37 -0
  21. data/cookbooks/apt/resources/repository.rb +60 -0
  22. data/cookbooks/apt/templates/debian-6.0/acng.conf.erb +173 -0
  23. data/cookbooks/apt/templates/default/01proxy.erb +9 -0
  24. data/cookbooks/apt/templates/default/10recommends.erb +3 -0
  25. data/cookbooks/apt/templates/default/20auto-upgrades.erb +2 -0
  26. data/cookbooks/apt/templates/default/50unattended-upgrades.erb +68 -0
  27. data/cookbooks/apt/templates/default/acng.conf.erb +275 -0
  28. data/cookbooks/apt/templates/default/unattended-upgrades.seed.erb +1 -0
  29. data/cookbooks/apt/templates/ubuntu-10.04/acng.conf.erb +269 -0
  30. data/cookbooks/build-essential/CHANGELOG.md +136 -0
  31. data/cookbooks/build-essential/README.md +108 -0
  32. data/cookbooks/build-essential/attributes/default.rb +20 -0
  33. data/cookbooks/build-essential/libraries/matchers.rb +5 -0
  34. data/cookbooks/build-essential/libraries/timing.rb +124 -0
  35. data/cookbooks/build-essential/libraries/xcode_command_line_tools.rb +210 -0
  36. data/cookbooks/build-essential/metadata.json +1 -0
  37. data/cookbooks/build-essential/recipes/_debian.rb +28 -0
  38. data/cookbooks/build-essential/recipes/_fedora.rb +32 -0
  39. data/cookbooks/build-essential/recipes/_freebsd.rb +24 -0
  40. data/cookbooks/build-essential/recipes/_mac_os_x.rb +22 -0
  41. data/cookbooks/build-essential/recipes/_omnios.rb +33 -0
  42. data/cookbooks/build-essential/recipes/_rhel.rb +36 -0
  43. data/cookbooks/build-essential/recipes/_smartos.rb +27 -0
  44. data/cookbooks/build-essential/recipes/_solaris2.rb +48 -0
  45. data/cookbooks/build-essential/recipes/_suse.rb +29 -0
  46. data/cookbooks/build-essential/recipes/default.rb +29 -0
  47. data/cookbooks/chef-sugar/CHANGELOG.md +159 -0
  48. data/cookbooks/chef-sugar/README.md +464 -0
  49. data/cookbooks/chef-sugar/metadata.json +1 -0
  50. data/cookbooks/chef-sugar/recipes/default.rb +34 -0
  51. data/cookbooks/openssl/CHANGELOG.md +30 -0
  52. data/cookbooks/openssl/README.md +115 -0
  53. data/cookbooks/openssl/attributes/default.rb +21 -0
  54. data/cookbooks/openssl/libraries/secure_password.rb +37 -0
  55. data/cookbooks/openssl/metadata.json +31 -0
  56. data/cookbooks/openssl/providers/x509.rb +94 -0
  57. data/cookbooks/openssl/recipes/default.rb +18 -0
  58. data/cookbooks/openssl/recipes/upgrade.rb +39 -0
  59. data/cookbooks/openssl/resources/x509.rb +16 -0
  60. data/cookbooks/postgresql/CHANGELOG.md +220 -0
  61. data/cookbooks/postgresql/README.md +464 -0
  62. data/cookbooks/postgresql/attributes/default.rb +549 -0
  63. data/cookbooks/postgresql/files/default/tests/minitest/apt_pgdg_postgresql_test.rb +39 -0
  64. data/cookbooks/postgresql/files/default/tests/minitest/default_test.rb +27 -0
  65. data/cookbooks/postgresql/files/default/tests/minitest/ruby_test.rb +28 -0
  66. data/cookbooks/postgresql/files/default/tests/minitest/server_test.rb +43 -0
  67. data/cookbooks/postgresql/files/default/tests/minitest/support/helpers.rb +29 -0
  68. data/cookbooks/postgresql/libraries/default.rb +377 -0
  69. data/cookbooks/postgresql/metadata.json +56 -0
  70. data/cookbooks/postgresql/recipes/apt_pgdg_postgresql.rb +18 -0
  71. data/cookbooks/postgresql/recipes/client.rb +32 -0
  72. data/cookbooks/postgresql/recipes/config_initdb.rb +148 -0
  73. data/cookbooks/postgresql/recipes/config_pgtune.rb +284 -0
  74. data/cookbooks/postgresql/recipes/contrib.rb +44 -0
  75. data/cookbooks/postgresql/recipes/default.rb +18 -0
  76. data/cookbooks/postgresql/recipes/ruby.rb +117 -0
  77. data/cookbooks/postgresql/recipes/server.rb +89 -0
  78. data/cookbooks/postgresql/recipes/server_conf.rb +34 -0
  79. data/cookbooks/postgresql/recipes/server_debian.rb +38 -0
  80. data/cookbooks/postgresql/recipes/server_redhat.rb +100 -0
  81. data/cookbooks/postgresql/recipes/yum_pgdg_postgresql.rb +45 -0
  82. data/cookbooks/postgresql/templates/default/pg_hba.conf.erb +35 -0
  83. data/cookbooks/postgresql/templates/default/pgsql.sysconfig.erb +4 -0
  84. data/cookbooks/postgresql/templates/default/postgresql.conf.erb +21 -0
  85. data/cookbooks/scratchify/.chef/knife.rb +2 -5
  86. data/cookbooks/scratchify/Berksfile +2 -1
  87. data/cookbooks/scratchify/Berksfile.lock +11 -0
  88. data/cookbooks/scratchify/README.md +34 -17
  89. data/cookbooks/scratchify/bin/scratchify +1 -1
  90. data/cookbooks/scratchify/chefignore +1 -0
  91. data/cookbooks/scratchify/from-scratch.gemspec +2 -5
  92. data/cookbooks/scratchify/lib/from-scratch.rb +25 -0
  93. data/cookbooks/scratchify/lib/{from/scratch → from-scratch}/version.rb +1 -1
  94. data/cookbooks/scratchify/metadata.json +2 -1
  95. data/cookbooks/scratchify/templates/node.json.erb +34 -0
  96. data/cookbooks/scratchify/templates/user.json.erb +6 -0
  97. data/lib/from-scratch.rb +2 -2
  98. data/lib/from-scratch/version.rb +1 -1
  99. data/templates/node.json.erb +6 -3
  100. metadata +85 -10
  101. data/cookbooks/scratchify/bin/console +0 -14
  102. data/cookbooks/scratchify/bin/setup +0 -7
  103. data/cookbooks/scratchify/data_bags/users/deploy.json +0 -6
  104. data/cookbooks/scratchify/environments/.gitkeep +0 -0
  105. data/cookbooks/scratchify/lib/from/scratch.rb +0 -31
  106. data/cookbooks/scratchify/lib/from/scratch/interviewer.rb +0 -35
  107. data/cookbooks/scratchify/nodes/normfood.ru.json +0 -75
  108. data/cookbooks/scratchify/roles/.gitkeep +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b496c570f495a440506371b464e4533fb5470bb
4
- data.tar.gz: 33954a19f5906d5b5c8af4d27cc0f95793084488
3
+ metadata.gz: 5fecc9619a3c03891cb931d42dbada9d76d11546
4
+ data.tar.gz: 354a0f61a77ac2a23608afcdfde4eb3966caf491
5
5
  SHA512:
6
- metadata.gz: c7fdbec146ed46a5ddd7eb85ed9f6888400074903d09484959665a242331490704cf6a17d2e6b728b87de8e7876294b99a5e8a47cd0d7a6ba9a0bb637722a680
7
- data.tar.gz: d390f3867386c55f06e2e4ad61c06acbe9c85c24529ac7125583b1fb2fb7b923fc673f6ef85ebd24fb5fd625cd634c18dfbf0c290ddd982647d5b70bd0afa2f4
6
+ metadata.gz: 38b9f37053254444604c73f57e56bb5d776be4d8ee13e40a86eaf9ce4598aba5c5f49b014b2e7a3a7036ed25db7cce17163f073f536300b87ed19cff31bcd330
7
+ data.tar.gz: 4f3f887a9d83e37c73fc1f2d7c004c1290c1a2d3512e8afe8afb1ba667fbb87d2930a45479f3b5f7e0cad7eb43333ca727b58728a40eabb9cd13a4db2c6577d1
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ *.gem
@@ -1,4 +1,5 @@
1
1
  DEPENDENCIES
2
+ postgresql
2
3
  rvm
3
4
  git: git://github.com/fnichol/chef-rvm.git
4
5
  revision: 08ec265f277e112a5a2e4b201bd32ddfe1bb968c
@@ -8,12 +9,22 @@ DEPENDENCIES
8
9
  user
9
10
 
10
11
  GRAPH
12
+ apt (2.9.2)
13
+ build-essential (2.2.4)
14
+ chef-sugar (3.1.1)
11
15
  chef_gem (0.1.0)
12
16
  java (1.35.0)
17
+ openssl (4.0.0)
18
+ chef-sugar (>= 0.0.0)
19
+ postgresql (3.4.20)
20
+ apt (>= 1.9.0)
21
+ build-essential (>= 0.0.0)
22
+ openssl (~> 4.0.0)
13
23
  rvm (0.10.1)
14
24
  chef_gem (>= 0.0.0)
15
25
  java (>= 0.0.0)
16
26
  scratchify (0.1.0)
27
+ postgresql (>= 0.0.0)
17
28
  rvm (>= 0.0.0)
18
29
  user (>= 0.0.0)
19
30
  user (0.4.2)
data/chefignore CHANGED
@@ -94,6 +94,7 @@ Vagrantfile
94
94
  .travis.yml
95
95
 
96
96
  # Gem files #
97
+ #############
97
98
  Gemfile
98
99
  Gemfile.lock
99
100
  Rakefile
@@ -0,0 +1,248 @@
1
+ apt Cookbook CHANGELOG
2
+ ======================
3
+
4
+ v2.9.2
5
+ -------------------
6
+ - #168 Adding guard to package resource.
7
+
8
+ v2.9.1
9
+ -------------------
10
+ - Adding package apt-transport-https to default.rb
11
+
12
+ v2.9.0
13
+ -------------------
14
+ - Add `sensitive` flag for apt\_repositories
15
+ - Enable installation of recommended or suggested packages
16
+ - Tidy up `apt-get update` logic
17
+ - Fixing not_if guard on ruby_block[validate-key #{key}]
18
+
19
+ v2.8.2 (2015-08-24)
20
+ -------------------
21
+ - Fix removal of apt\_preferences
22
+
23
+ v2.8.1 (2015-08-18)
24
+ -------------------
25
+ - Handle keyservers as URLs and bare hostnames
26
+
27
+ v2.8.0 (2015-08-18)
28
+ -------------------
29
+ - Access keyservers on port 80
30
+ - Adds key\_proxy as LWRP attribute for apt\_repository
31
+ - Fix wildcard glob preferences files
32
+ - Fix text output verification for non en\_US locales
33
+ - Quote repo URLs to deal with spaces
34
+
35
+ v2.7.0 (2015-03-23)
36
+ -------------------
37
+ - Support Debian 8.0
38
+ - Filename verification for LWRPs
39
+ - Support SSL enabled apt repositories
40
+
41
+ v2.6.1 (2014-12-29)
42
+ -------------------
43
+ - Remove old preference files without .pref extension from previous versions
44
+
45
+ v2.6.0 (2014-09-09)
46
+ -------------------
47
+ - Always update on first run - check
48
+ - Adding ppa support for apt_repository
49
+
50
+ v2.5.3 (2014-08-14)
51
+ -------------------
52
+ - #87 - Improve default settings, account for non-linux platforms
53
+
54
+ v2.5.2 (2014-08-14)
55
+ -------------------
56
+ - Fully restore 2.3.10 behaviour
57
+
58
+ v2.5.1 (2014-08-14)
59
+ -------------------
60
+ - fix breakage introduced in apt 2.5.0
61
+
62
+ v2.5.0 (2014-08-12)
63
+ -------------------
64
+ - Add unattended-upgrades recipe
65
+ - Only update the cache for the created repository
66
+ - Added ChefSpec matchers and default_action for resources
67
+ - Avoid cloning resource attributes
68
+ - Minor documentation updates
69
+
70
+ v2.4.0 (2014-05-15)
71
+ -------------------
72
+ - [COOK-4534]: Add option to update apt cache at compile time
73
+
74
+
75
+ v2.3.10 (2014-04-23)
76
+ --------------------
77
+ - [COOK-4512] Bugfix: Use empty PATH if PATH is nil
78
+
79
+
80
+ v2.3.8 (2014-02-14)
81
+ -------------------
82
+ ### Bug
83
+ - **[COOK-4287](https://tickets.chef.io/browse/COOK-4287)** - Cleanup the Kitchen
84
+
85
+
86
+ v2.3.6
87
+ ------
88
+ * [COOK-4154] - Add chefspec matchers.rb file to apt cookbook
89
+ * [COOK-4102] - Only index created repository
90
+
91
+
92
+ v2.3.6
93
+ ------
94
+ * [COOK-4154] - Add chefspec matchers.rb file to apt cookbook
95
+ * [COOK-4102] - Only index created repository
96
+
97
+
98
+ v2.3.4
99
+ ------
100
+ No change. Version bump for toolchain sanity
101
+
102
+
103
+ v2.3.2
104
+ ------
105
+ - [COOK-3905] apt-get-update-periodic: configuration for the update period
106
+ - Updating style for rubocops
107
+ - Updating test-kitchen harness
108
+
109
+
110
+ v2.3.0
111
+ ------
112
+ ### Bug
113
+ - **[COOK-3812](https://tickets.chef.io/browse/COOK-3812)** - Add a way to bypass the apt existence check
114
+
115
+ ### Improvement
116
+ - **[COOK-3567](https://tickets.chef.io/browse/COOK-3567)** - Allow users to bypass apt-cache via attributes
117
+
118
+
119
+ v2.2.1
120
+ ------
121
+ ### Improvement
122
+ - **[COOK-664](https://tickets.chef.io/browse/COOK-664)** - Check platform before running apt-specific commands
123
+
124
+
125
+ v2.2.0
126
+ ------
127
+ ### Bug
128
+ - **[COOK-3707](https://tickets.chef.io/browse/COOK-3707)** - multiple nics confuse apt::cacher-client
129
+
130
+ v2.1.2
131
+ ------
132
+ ### Improvement
133
+ - **[COOK-3551](https://tickets.chef.io/browse/COOK-3551)** - Allow user to set up a trusted APT repository
134
+
135
+ v2.1.1
136
+ ------
137
+ ### Bug
138
+ - **[COOK-1856](https://tickets.chef.io/browse/COOK-1856)** - Match GPG keys without case sensitivity
139
+
140
+ v2.1.0
141
+ ------
142
+ - [COOK-3426]: cacher-ng fails with restrict_environment set to true
143
+ - [COOK-2859]: cacher-client executes out of order
144
+ - [COOK-3052]: Long GPG keys are downloaded on every run
145
+ - [COOK-1856]: apt cookbook should match keys without case sensitivity
146
+ - [COOK-3255]: Attribute name incorrect in README
147
+ - [COOK-3225]: Call use_inline_resources only if defined
148
+ - [COOK-3386]: Cache dir for apt-cacher-ng
149
+ - [COOK-3291]: apt_repository: enable usage of a keyserver on port 80
150
+ - Greatly expanded test coverage with ChefSpec and Test-Kitchen
151
+
152
+ v2.0.0
153
+ ------
154
+ ### Bug
155
+
156
+ - [COOK-2258]: apt: LWRP results in error under why-run mode in apt 1.9.0 cookbook
157
+
158
+ v1.10.0
159
+ -------
160
+ ### Improvement
161
+
162
+ - [COOK-2885]: Improvements for apt cache server search
163
+
164
+ ### Bug
165
+
166
+ - [COOK-2441]: Apt recipe broken in new chef version
167
+ - [COOK-2660]: Create Debian 6.0 "squeeze" specific template for
168
+ apt-cacher-ng
169
+
170
+ v1.9.2
171
+ ------
172
+ - [COOK-2631] - Create Ubuntu 10.04 specific template for apt-cacher-ng
173
+
174
+ v1.9.0
175
+ ------
176
+ - [COOK-2185] - Proxy for apt-key
177
+ - [COOK-2338] - Support pinning by glob() or regexp
178
+
179
+ v1.8.4
180
+ ------
181
+ - [COOK-2171] - Update README to clarify required Chef version: 10.18.0
182
+ or higher.
183
+
184
+ v1.8.2
185
+ ------
186
+ - [COOK-2112] - need [] around "arch" in sources.list entries
187
+ - [COOK-2171] - fixes a regression in the notification
188
+
189
+ v1.8.0
190
+ ------
191
+ - [COOK-2143] - Allow for a custom cacher-ng port
192
+ - [COOK-2171] - On `apt_repository.run_action(:add)` the source file
193
+ is not created.
194
+ - [COOK-2184] - apt::cacher-ng, use `cacher_port` attribute in
195
+ acng.conf
196
+
197
+ v1.7.0
198
+ ------
199
+ - [COOK-2082] - add "arch" parameter to apt_repository LWRP
200
+
201
+ v1.6.0
202
+ ------
203
+ - [COOK-1893] - `apt_preference` use "`package_name`" resource instead of "name"
204
+ - [COOK-1894] - change filename for sources.list.d files
205
+ - [COOK-1914] - Wrong dir permissions for /etc/apt/preferences.d/
206
+ - [COOK-1942] - README.md has wrong name for the keyserver attribute
207
+ - [COOK-2019] - create 01proxy before any other apt-get updates get executed
208
+
209
+ v1.5.2
210
+ ------
211
+ - [COOK-1682] - use template instead of file resource in apt::cacher-client
212
+ - [COOK-1875] - cacher-client should be Environment-aware
213
+
214
+ V1.5.0
215
+ ------
216
+ - [COOK-1500] - Avoid triggering apt-get update
217
+ - [COOK-1548] - Add execute commands for autoclean and autoremove
218
+ - [COOK-1591] - Setting up the apt proxy should leave https
219
+ connections direct
220
+ - [COOK-1596] - execute[apt-get-update-periodic] never runs
221
+ - [COOK-1762] - create /etc/apt/preferences.d directory
222
+ - [COOK-1776] - apt key check isn't idempotent
223
+
224
+ v1.4.8
225
+ ------
226
+ * Adds test-kitchen support
227
+ - [COOK-1435] - repository lwrp is not idempotent with http key
228
+
229
+ v1.4.6
230
+ ------
231
+ - [COOK-1530] - apt_repository isn't aware of update-success-stamp
232
+ file (also reverts COOK-1382 patch).
233
+
234
+ v1.4.4
235
+ ------
236
+ - [COOK-1229] - Allow cacher IP to be set manually in non-Chef Solo
237
+ environments
238
+ - [COOK-1530] - Immediately update apt-cache when sources.list file is dropped off
239
+
240
+ v1.4.2
241
+ ------
242
+ - [COOK-1155] - LWRP for apt pinning
243
+
244
+ v1.4.0
245
+ ------
246
+ - [COOK-889] - overwrite existing repo source files
247
+ - [COOK-921] - optionally use cookbook\_file or remote\_file for key
248
+ - [COOK-1032] - fixes problem with apt repository key installation
@@ -0,0 +1,294 @@
1
+ apt Cookbook
2
+ ============
3
+ [![Build Status](https://img.shields.io/travis/chef-cookbooks/apt.svg)][travis]
4
+ [![Cookbook Version](https://img.shields.io/cookbook/v/apt.svg)][cookbook]
5
+
6
+ [cookbook]: https://community.chef.io/cookbooks/apt
7
+ [travis]: https://travis-ci.org/chef-cookbooks/apt
8
+
9
+ This 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.
10
+
11
+
12
+ Requirements
13
+ ------------
14
+ **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.
15
+
16
+ Version 1.8.2 to 1.10.0 of this cookbook requires **Chef 10.16.4** or later.
17
+
18
+ If your Chef version is earlier than 10.16.4, use version 1.7.0 of this cookbook.
19
+
20
+ ### Platform
21
+ Please refer to the [TESTING file](TESTING.md) to see the currently (and passing) tested platforms. The release was tested on:
22
+
23
+ * Ubuntu 10.04
24
+ * Ubuntu 12.04
25
+ * Ubuntu 13.04
26
+ * Debian 7.1
27
+ * Debian 6.0 (have with manual testing)
28
+
29
+ May work with or without modification on other Debian derivatives.
30
+
31
+
32
+ -------
33
+ ### default
34
+ This recipe manually updates the timestamp file used to only run `apt-get update` if the cache is more than one day old.
35
+
36
+ This 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.
37
+
38
+ This recipe also sets up a local cache directory for preseeding packages.
39
+
40
+ **Including the default recipe on a node that does not support apt (such as Windows) results in a noop.**
41
+
42
+ ### cacher-client
43
+ Configures the node to use the `apt-cacher-ng` server as a client.
44
+
45
+ #### Bypassing the cache
46
+ Occasionally 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.
47
+
48
+ To 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:
49
+
50
+ ```json
51
+ {
52
+ "apt": {
53
+ "cache_bypass": {
54
+ "URL": "PROTOCOL"
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ For example, to prevent caching and directly connect to the repository at `download.oracle.com` via http:
61
+
62
+ ```json
63
+ {
64
+ "apt": {
65
+ "cache_bypass": {
66
+ "download.oracle.com": "http"
67
+ }
68
+ }
69
+ }
70
+ ```
71
+
72
+ ### cacher-ng
73
+ Installs 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.
74
+
75
+ If 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`).
76
+
77
+ ### unattended-upgrades
78
+
79
+ Installs and configures the `unattended-upgrades` package to provide automatic package updates. This can be configured to upgrade all packages or to just install security updates by setting `['apt']['unattended_upgrades']['allowed_origins']`.
80
+
81
+ To pull just security updates, you'd set `allowed_origins` to something link `["Ubuntu trusty-security"]` (for Ubuntu trusty) or `["Debian wheezy-security"]` (for Debian wheezy).
82
+
83
+
84
+ Attributes
85
+ ----------
86
+
87
+ ### General
88
+ * `['apt']['compile_time_update']` - force the default recipe to run `apt-get update` at compile time.
89
+ * `['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)
90
+
91
+ ### Caching
92
+
93
+ * `['apt']['cacher_ipaddress']` - use a cacher server (or standard proxy server) not available via search
94
+ * `['apt']['cacher_interface']` - interface to connect to the cacher-ng service, no default.
95
+ * `['apt']['cacher_port']` - port for the cacher-ng service (either client or server), default is '3142'
96
+ * `['apt']['cacher_ssl_support']` - indicates whether the cacher supports upstream SSL servers, default is 'false'
97
+ * `['apt']['cacher_dir']` - directory used by cacher-ng service, default is '/var/cache/apt-cacher-ng'
98
+ * `['apt']['cacher-client']['restrict_environment']` - restrict your node to using the `apt-cacher-ng` server in your Environment, default is 'false'
99
+ * `['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'
100
+ * `['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
101
+
102
+ ### Unattended Upgrades
103
+
104
+ * `['apt']['unattended_upgrades']['enable']` - enables unattended upgrades, default is false
105
+ * `['apt']['unattended_upgrades']['update_package_lists']` - automatically update package list (`apt-get update`) daily, default is true
106
+ * `['apt']['unattended_upgrades']['allowed_origins']` - array of allowed apt origins from which to pull automatic upgrades, defaults to a guess at the system's main origin and should almost always be overridden
107
+ * `['apt']['unattended_upgrades']['package_blacklist']` - an array of package which should never be automatically upgraded, defaults to none
108
+ * `['apt']['unattended_upgrades']['auto_fix_interrupted_dpkg']` - attempts to repair dpkg state with `dpkg --force-confold --configure -a` if it exits uncleanly, defaults to false (contrary to the unattended-upgrades default)
109
+ * `['apt']['unattended_upgrades']['minimal_steps']` - Split the upgrade into the smallest possible chunks. 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). Defaults to false.
110
+ * `['apt']['unattended_upgrades']['install_on_shutdown']` - Install 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. Defaults to false.
111
+ * `['apt']['unattended_upgrades']['mail']` - Send email to this address for problems or packages upgrades. Defaults to no email.
112
+ * `['apt']['unattended_upgrades']['mail_only_on_error']` - If set, email will only be set on upgrade errors. Otherwise, an email will be sent after each upgrade. Defaults to true.
113
+ * `['apt']['unattended_upgrades']['remove_unused_dependencies']` Do automatic removal of new unused dependencies after the upgrade. Defaults to false.
114
+ * `['apt']['unattended_upgrades']['automatic_reboot']` - Automatically reboots *without confirmation* if a restart is required after the upgrade. Defaults to false.
115
+ * `['apt']['unattended_upgrades']['dl_limit']` - Limits the bandwidth used by apt to download packages. Value given as an integer in kb/sec. Defaults to nil (no limit).
116
+
117
+ ### Configuration for APT
118
+
119
+ * `['apt']['confd']['install_recommends']` - Consider recommended packages as a dependency for installing. (default: true)
120
+ * `['apt']['confd']['install_suggests']` - Consider suggested packages as a dependency for installing. (default: false)
121
+
122
+ Libraries
123
+ ---------
124
+ There 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.
125
+
126
+ Resources/Providers
127
+ -------------------
128
+ ### `apt_repository`
129
+ 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.
130
+
131
+ #### Actions
132
+ - :add: creates a repository file and builds the repository listing (default)
133
+ - :remove: removes the repository file
134
+
135
+ #### Attribute Parameters
136
+ - repo_name: name attribute. The name of the channel to discover
137
+ - uri: the base of the Debian distribution
138
+ - distribution: this is usually your release's codename...ie something like `karmic`, `lucid` or `maverick`
139
+ - components: package groupings... when in doubt use `main`
140
+ - arch: constrain package to a particular arch like `i386`, `amd64` or even `armhf` or `powerpc`. Defaults to nil.
141
+ - trusted: treat all packages from this repository as authenticated regardless of signature
142
+ - deb_src: whether or not to add the repository as a source repo as well - value can be `true` or `false`, default `false`.
143
+ - keyserver: the GPG keyserver where the key for the repo should be retrieved
144
+ - 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.
145
+ - key_proxy: if set, pass the specified proxy via `http-proxy=` to GPG.
146
+ - 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.
147
+
148
+ #### Examples
149
+
150
+ Add the Zenoss repo:
151
+
152
+ ```ruby
153
+ apt_repository 'zenoss' do
154
+ uri 'http://dev.zenoss.org/deb'
155
+ components ['main', 'stable']
156
+ end
157
+ ```
158
+
159
+ Enable Ubuntu [multiverse](https://help.ubuntu.com/community/Repositories/Ubuntu) repositories:
160
+
161
+ ```ruby
162
+ apt_repository 'security-ubuntu-multiverse' do
163
+ uri 'http://security.ubuntu.com/ubuntu'
164
+ distribution 'trusty-security'
165
+ components ['multiverse']
166
+ deb_src 'true'
167
+ end
168
+ ```
169
+
170
+ Add the Nginx PPA, autodetect the key and repository url:
171
+
172
+ ```ruby
173
+ apt_repository 'nginx-php' do
174
+ uri 'ppa:nginx/stable'
175
+ distribution node['lsb']['codename']
176
+ end
177
+ ```
178
+
179
+ Add the JuJu PPA, grab the key from the keyserver, and add source repo:
180
+
181
+ ```ruby
182
+ apt_repository 'juju' do
183
+ uri 'http://ppa.launchpad.net/juju/stable/ubuntu'
184
+ components ['main']
185
+ distribution 'trusty'
186
+ key 'C8068B11'
187
+ keyserver 'keyserver.ubuntu.com'
188
+ action :add
189
+ deb_src true
190
+ end
191
+ ```
192
+
193
+ Add the Cloudera Repo of CDH4 packages for Ubuntu 12.04 on AMD64:
194
+
195
+ ```ruby
196
+ apt_repository 'cloudera' do
197
+ uri 'http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh'
198
+ arch 'amd64'
199
+ distribution 'precise-cdh4'
200
+ components ['contrib']
201
+ key 'http://archive.cloudera.com/debian/archive.key'
202
+ end
203
+ ```
204
+
205
+ Remove Zenoss repo:
206
+
207
+ ```ruby
208
+ apt_repository 'zenoss' do
209
+ action :remove
210
+ end
211
+ ```
212
+
213
+ ### `apt_preference`
214
+ This 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.
215
+
216
+ Further information regarding apt-pinning is available via http://wiki.debian.org/AptPreferences.
217
+
218
+ #### Actions
219
+ - :add: creates a preferences file under /etc/apt/preferences.d
220
+ - :remove: Removes the file, therefore unpin the package
221
+
222
+ #### Attribute Parameters
223
+ - package_name: name attribute. The name of the package
224
+ - glob: Pin by glob() expression or regexp surrounded by /.
225
+ - pin: The package version/repository to pin
226
+ - pin_priority: The pinning priority aka "the highest package version wins"
227
+
228
+ #### Examples
229
+ Pin libmysqlclient16 to version 5.1.49-3:
230
+
231
+ ```ruby
232
+ apt_preference 'libmysqlclient16' do
233
+ pin 'version 5.1.49-3'
234
+ pin_priority '700'
235
+ end
236
+ ```
237
+
238
+ Unpin libmysqlclient16:
239
+
240
+ ```ruby
241
+ apt_preference 'libmysqlclient16' do
242
+ action :remove
243
+ end
244
+ ```
245
+
246
+ Pin all packages from dotdeb.org:
247
+
248
+ ```ruby
249
+ apt_preference 'dotdeb' do
250
+ glob '*'
251
+ pin 'origin packages.dotdeb.org'
252
+ pin_priority '700'
253
+ end
254
+ ```
255
+
256
+
257
+ Usage
258
+ -----
259
+ Put `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.:
260
+
261
+ ```ruby
262
+ template '/etc/apt/sources.list.d/my_apt_sources.list' do
263
+ notifies :run, 'execute[apt-get update]', :immediately
264
+ end
265
+ ```
266
+
267
+ The 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.
268
+
269
+ Put `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.
270
+
271
+ If you want to cleanup unused packages, there is also the `apt-get autoclean` and `apt-get autoremove` resources provided for automated cleanup.
272
+
273
+
274
+ License & Authors
275
+ -----------------
276
+ - Author:: Joshua Timberman (joshua@chef.io)
277
+ - Author:: Matt Ray (matt@chef.io)
278
+ - Author:: Seth Chisamore (schisamo@chef.io)
279
+
280
+ ```text
281
+ Copyright:: 2009-2015, Chef Software, Inc
282
+
283
+ Licensed under the Apache License, Version 2.0 (the "License");
284
+ you may not use this file except in compliance with the License.
285
+ You may obtain a copy of the License at
286
+
287
+ http://www.apache.org/licenses/LICENSE-2.0
288
+
289
+ Unless required by applicable law or agreed to in writing, software
290
+ distributed under the License is distributed on an "AS IS" BASIS,
291
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
292
+ See the License for the specific language governing permissions and
293
+ limitations under the License.
294
+ ```