OSDN Git Service

refactoring.
[metasearch/grid-chef-repo.git] / roles / docker.rb
1 #
2 # Copyright 2016-2018, whitestar
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16
17 name 'docker'
18 description 'Docker Engine'
19
20 # if you set `nil` to its attribute, you can deactivate its override.
21 docker_ver_on_centos = '17.12.1.ce-1'
22 docker_ver_on_ubuntu = '17.12.1~ce-0'
23 docker_compose_ver = '1.21.2'
24
25 docker_bip        = '192.168.100.1/24'
26 docker_fixed_cidr = '192.168.100.0/24'
27
28 run_list(
29   'role[docker-new-repo]',
30 )
31
32 #env_run_lists
33
34 default_attributes(
35 )
36
37 override_attributes(
38   'docker-grid' => {
39     'engine' => {
40       #'version' => '',  # '' (=latest) or exact version
41       'version_on_centos' => docker_ver_on_centos,  # '18.06.0.ce-3', '18.03.1.ce-1', '17.12.1.ce-1'
42       'version_on_ubuntu' => docker_ver_on_ubuntu,  # '18.06.0~ce~3-0', '18.03.1~ce-0', '17.12.1~ce-0' 
43       #'storage-driver_on_centos' => 'overlay',   # defacto: 'devicemapper'
44       #'storage-driver_on_ubuntu' => 'overlay2',  # defacto: 'aufs'
45       'daemon_extra_options' => [
46         '-H fd://',
47         "--bip=#{docker_bip} --fixed-cidr=#{docker_fixed_cidr}",
48       ].join(' '),
49     },
50     'compose' => {
51       'version' => docker_compose_ver,
52     },
53   },
54 )