OSDN Git Service

add .envrc
[metasearch/grid-chef-repo.git] / roles / docker.rb
index e029a44..a662cc1 100644 (file)
@@ -1,8 +1,34 @@
+#
+# Copyright 2016-2019, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 name 'docker'
 description 'Docker Engine'
 
+# if you set `nil` to its attribute, you can deactivate its override.
+docker_ver_on_centos = nil
+#docker_ver_on_centos = '17.12.1.ce-1'
+docker_ver_on_ubuntu = nil
+#docker_ver_on_ubuntu = '17.12.1~ce-0'
+docker_compose_ver = '1.24.0'
+
+docker_bip        = '192.168.100.1/24'
+docker_fixed_cidr = '192.168.100.0/24'
+
 run_list(
-  'recipe[docker-grid::engine]',
+  'role[docker-new-repo]',
 )
 
 #env_run_lists
@@ -12,23 +38,19 @@ default_attributes(
 
 override_attributes(
   'docker-grid' => {
-    'install_flavor' => 'dockerproject',
-    #'install_flavor' => 'os-repository',
     'engine' => {
-      #'version_on_centos' => '1.13.0-1',  # docker-engine package
-      #'version_on_centos' => '1.12.6-1',  # docker-engine package
-      #'version_on_centos' => '1.12.5-14',  # docker package
-      'version_on_centos' => '1.11.2-1',  # docker-engine package
-      #'version_on_ubuntu' => '1.13.0-0',  # docker-engine package
-      #'version_on_ubuntu' => '1.12.3-0',  # docker-engine package
-      #'version_on_ubuntu' => '1.12.3-0ubuntu4~16.04.2',  # docker.io package
-      'version_on_ubuntu' => '1.11.2-0',  # docker-engine package
-      'storage-driver_on_centos' => 'overlay',
-      'storage-driver_on_ubuntu' => 'overlay',  # default: aufs
-      #'userns-remap' => 'default',
-      'daemon_extra_options' => '-H fd://',
-      # for docker, docker-engine package >= 1.12 (on rhel family): '-H fd://' option automatically removed by this cookbook.
-      # See https://github.com/docker/docker/issues/22847
+      #'version' => '',  # '' (=latest) or exact version
+      'version_on_centos' => docker_ver_on_centos,  # '18.06.0.ce-3', '18.03.1.ce-1', '17.12.1.ce-1'
+      'version_on_ubuntu' => docker_ver_on_ubuntu,  # '18.06.0~ce~3-0', '18.03.1~ce-0', '17.12.1~ce-0' 
+      #'storage-driver_on_centos' => 'overlay2',  # defacto: 'devicemapper'
+      #'storage-driver_on_ubuntu' => 'overlay2',  # defacto: 'aufs'
+      'daemon_extra_options' => [
+        '-H fd://',
+        "--bip=#{docker_bip} --fixed-cidr=#{docker_fixed_cidr}",
+      ].join(' '),
+    },
+    'compose' => {
+      'version' => docker_compose_ver,
     },
   },
 )