4 This cookbook includes apt utility (apt-cacher-ng, apt mirroring site setup and apt source configuration) recipes.
8 - [Requirements](#requirements)
9 - [packages](#packages)
10 - [Attributes](#attributes)
11 - [apt_utils::default](#apt_utilsdefault)
14 - [apt_utils::apt](#apt_utilsapt)
15 - [apt_utils::aptly](#apt_utilsaptly)
16 - [apt_utils::aptly-docker-compose](#apt_utilsaptly-docker-compose)
17 - [SSL server keys and certificates management by the `ssl_cert` cookbook](#ssl-server-keys-and-certificates-management-by-the-ssl_cert-cookbook)
18 - [apt_utils::conf](#apt_utilsconf)
19 - [apt_utils::apt-cacher-ng](#apt_utilsapt-cacher-ng)
20 - [apt_utils::mirror](#apt_utilsmirror)
21 - [apt_utils::source](#apt_utilssource)
22 - [License and Authors](#license-and-authors)
29 - `docker-grid` >= 0.2.7
30 - `platform_utils` >= 0.4.3
36 ### apt_utils::default
38 |Key|Type|Description (with examples)|Default|
40 |`['apt_utils']['conf']['proxy']['sequence']`|String|Sequence number of apt proxy configuration file (ver. 0.1.1 or later)|`'80'`|
41 |`['apt_utils']['conf']['proxy']['ftp']`|String|Proxy setting for FTP (ver. 0.1.1 or later)|`'nil'`|
42 |`['apt_utils']['conf']['proxy']['http']`|String|Proxy setting for HTTP (ver. 0.1.1 or later)|`'nil'`|
43 |`['apt_utils']['conf']['proxy']['https']`|String|Proxy setting for HTTPS (ver. 0.1.1 or later)|`'nil'`|
44 |`['apt_utils']['aptly']['apt_repo']['keyserver']`|String||`'keys.gnupg.net'`|
45 |`['apt_utils']['aptly']['apt_repo']['recv-keys']`|String||`'9E3E53F19C7DE460'`|
46 |`['apt_utils']['aptly']['user']`|String||`'root'`|
47 |`['apt_utils']['aptly']['conf']`|Hash|`aptly.conf` configurations.|See `attributes/default.rb`|
48 |`['apt_utils']['aptly']['with_ssl_cert_cookbook']`|Boolean|Activates TLS configurations by the `ssl_cert` cookbook. See `attributes/default.rb`|`false`|
49 |`['apt_utils']['aptly']['ssl_cert']['common_name']`|String|Server common name for TLS|`node['fqdn']`|
50 |`['apt_utils']['aptly']['docker-compose']['app_dir']`|String|aptly app. root directory for docker-compose.|`"#{node['docker-grid']['compose']['app_dir']}/aptly"`|
51 |`['apt_utils']['aptly']['docker-compose']['etc_dir']`|String||`"#{node['apt_utils']['aptly']['docker-compose']['app_dir']}/etc"`|
52 |`['apt_utils']['aptly']['docker-compose']['data_dir']`|String|Persistent volume path or nil (unset).|`"#{node['apt_utils']['aptly']['docker-compose']['app_dir']}/data"`|
53 |`['apt_utils']['aptly']['docker-compose']['config']`|Hash|`docker-compose.yml` configurations.|See `attributes/default.rb`|
54 |`['apt_utils']['apt-cacher-ng']['CacheDir']`|String|path to cache directory|`'/var/cache/apt-cacher-ng'`|
55 |`['apt_utils']['apt-cacher-ng']['LogDir']`|String|path to log directory.|`'/var/log/apt-cacher-ng'`|
56 |`['apt_utils']['apt-cacher-ng']['Port']`|String|service port number.|`'3142'`|
57 |`['apt_utils']['apt-cacher-ng']['BindAddress']`|String|service bind address|`''` (0.0.0.0)|
58 |`['apt_utils']['apt-cacher-ng']['UseWrap']`|String|with TCP Wrappers (ver. 0.1.2 or later)|`nil` (`'0'`(default) or `'1'` (on))|
59 |`['apt_utils']['mirror']['user']`|String|service user.|`'apt-mirror'`|
60 |`['apt_utils']['mirror']['cron_period']`|String|cron period expression.|`'#0 4 * * *'` (inactive)|
61 |`['apt_utils']['mirror']['base_path']`|String|mirroring base path.|`'/var/spool/apt-mirror'`|
62 |`['apt_utils']['mirror']['nthreads']`|String|worker threads number.|`'20'`|
63 |`['apt_utils']['mirror']['_tilde']`|||`'0'`|
64 |`['apt_utils']['mirror']['country']`|String|mirroring source country.|`'us'`|
65 |`['apt_utils']['mirror']['distributions']['debian']`|Hash|Debian's mirroring apt lines.|refer to `attributes/default.rb`|
66 |`['apt_utils']['mirror']['distributions']['ubuntu']`|Hash|Ubuntu's mirroring apt lines.|refer to `attributes/default.rb`|
67 |`['apt_utils']['source']['apt_lines']['ubuntu']`|Array|apt source lines.|refer to `attributes/default.rb`|
75 - includes `apt::default` recipe if the platform family is `debian`.
79 This recipe installs `aptly` package.
81 - `roles/aptly.rb`: role example.
88 'recipe[apt_utils::aptly]',
92 #### apt_utils::aptly-docker-compose
94 This recipe generates a `docker-compose.yml` file for the aptly service.
96 - `roles/aptly-docker-compose.rb`: role example.
99 name 'aptly-docker-compose'
100 description 'aptly by docker-compose'
104 'recipe[apt_utils::aptly-docker-compose]',
108 aptly_api_port = '8081'
113 'docker-compose' => {
119 "#{aptly_port}:8080",
120 "#{aptly_api_port}:8081",
123 # This volume will be set by the apt_utils::aptly-docker-compose recipe automatically.
124 #"#{node['apt_utils']['aptly']['docker-compose']['etc_dir']}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
128 'restart' => 'always',
129 'image' => 'whitestar/aptly',
131 # This volume will be set by the apt_utils::aptly-docker-compose recipe automatically.
132 #"#{node['apt_utils']['aptly']['docker-compose']['data_dir']}:/aptly-data:rw",
145 - `roles/aptly-with-ssl-docker-compose.rb`: SSL setup role example.
148 name 'aptly-with-ssl-docker-compose'
149 description 'aptly with SSL by docker-compose'
152 #'recipe[ssl_cert::server_key_pairs]', # apt_utils cookbook < 0.2.4
154 'recipe[apt_utils::aptly-docker-compose]',
158 aptly_api_port = '8081'
159 cn = 'aptly.io.example.com'
164 # cn, # apt_utils cookbook <= 0.2.6
169 'with_ssl_cert_cookbook' => true,
173 'docker-compose' => {
179 "#{aptly_port}:8080",
180 "#{aptly_api_port}:8081",
183 # These volumes will be set by the apt_utils::aptly-docker-compose recipe automatically.
184 #"#{node['apt_utils']['aptly']['docker-compose']['etc_dir']}/nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
185 # and server key pair volume conf.
189 'restart' => 'always',
190 'image' => 'whitestar/aptly',
192 # This volume will be set by the apt_utils::aptly-docker-compose recipe automatically.
193 #"#{node['apt_utils']['aptly']['docker-compose']['data_dir']}:/aptly-data:rw",
206 ##### SSL server keys and certificates management by the `ssl_cert` cookbook
208 - create vault items.
211 $ ruby -rjson -e 'puts JSON.generate({"private" => File.read("aptly.io.example.com.prod.key")})' \
212 > > ~/tmp/aptly.io.example.com.prod.key.json
214 $ ruby -rjson -e 'puts JSON.generate({"public" => File.read("aptly.io.example.com.prod.crt")})' \
215 > > ~/tmp/aptly.io.example.com.prod.crt.json
219 $ knife vault create ssl_server_keys aptly.io.example.com.prod \
220 > --json ~/tmp/aptly.io.example.com.prod.key.json
222 $ knife vault create ssl_server_certs aptly.io.example.com.prod \
223 > --json ~/tmp/aptly.io.example.com.prod.crt.json
226 - grant reference permission to the Concourse host
229 $ knife vault update ssl_server_keys aptly.io.example.com.prod -S 'name:aptly-host.example.com'
230 $ knife vault update ssl_server_certs aptly.io.example.com.prod -S 'name:aptly-host.example.com'
233 - modify run_list and attributes
237 #'recipe[ssl_cert::server_key_pairs]', # apt_utils cookbook < 0.2.4
238 'recipe[apt_utils::aptly-docker-compose]',
244 # 'aptly.io.example.com', # apt_utils cookbook < 0.2.6
248 'with_ssl_cert_cookbook' => true,
250 'common_name' => 'nexus.io.example.com',
259 - deploys apt configuration files to the `/etc/apt/apt.conf.d` directory.
261 #### apt_utils::apt-cacher-ng
267 "recipe[apt_utils::apt-cacher-ng]"
272 #### apt_utils::mirror
278 "recipe[apt_utils::mirror]"
283 #### apt_utils::source
289 "recipe[apt_utils::source]"
294 ## License and Authors
296 - Author:: whitestar at osdn.jp
299 Copyright 2013-2017, whitestar
301 Licensed under the Apache License, Version 2.0 (the "License");
302 you may not use this file except in compliance with the License.
303 You may obtain a copy of the License at
305 http://www.apache.org/licenses/LICENSE-2.0
307 Unless required by applicable law or agreed to in writing, software
308 distributed under the License is distributed on an "AS IS" BASIS,
309 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
310 See the License for the specific language governing permissions and
311 limitations under the License.