• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: コミット

Grid環境構築用のChefリポジトリです。


コミットメタ情報

リビジョン882a31223044d289728fbd66588d732e09e7b679 (tree)
日時2018-07-19 17:46:28
作者whitestar <whitestar@user...>
コミッターwhitestar

ログメッセージ

add repository update flag.

変更サマリ

差分

--- a/cookbooks/kata-containers/CHANGELOG.md
+++ b/cookbooks/kata-containers/CHANGELOG.md
@@ -1,5 +1,9 @@
11 # kata-containers CHANGELOG
22
3+0.3.0
4+-----
5+- add repository update flag
6+
37 0.2.1
48 -----
59 - update documents.
--- a/cookbooks/kata-containers/README.md
+++ b/cookbooks/kata-containers/README.md
@@ -29,6 +29,7 @@ This cookbook installs Kata Containers.
2929
3030 |Key|Type|Description, example|Default|
3131 |:--|:--|:--|:--|
32+|`['kata-containers']['repo']['update']`|Boolean|Repository update flag.|`false`|
3233
3334 ## Usage
3435
--- /dev/null
+++ b/cookbooks/kata-containers/attributes/default.rb
@@ -0,0 +1,20 @@
1+#
2+# Cookbook Name:: kata-containers
3+# Attributes:: default
4+#
5+# Copyright 2018, whitestar
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+default['kata-containers']['repo']['update'] = false
--- a/cookbooks/kata-containers/recipes/default.rb
+++ b/cookbooks/kata-containers/recipes/default.rb
@@ -32,10 +32,13 @@ when 'centos', 'redhat'
3232 bash 'add_kata-containers_repo' do
3333 code <<-"EOH"
3434 source /etc/os-release
35+ if [ -f /etc/yum.repos.d/*katacontainers*.repo ]; then
36+ rm /etc/yum.repos.d/*katacontainers*.repo
37+ fi
3538 yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/release/CentOS_${VERSION_ID}/home:katacontainers:release.repo"
3639 EOH
3740 action :nothing
38- not_if "yum repolist | grep 'katacontainers'"
41+ not_if "yum repolist | grep 'katacontainers'" unless node['kata-containers']['repo']['update']
3942 end
4043
4144 [
@@ -49,6 +52,14 @@ when 'centos', 'redhat'
4952 end
5053 }
5154 when 'ubuntu'
55+ [
56+ 'curl',
57+ ].each {|pkg_name|
58+ resources(package: pkg_name) rescue package pkg_name do
59+ action :install
60+ end
61+ }
62+
5263 apt_get_update = 'apt-get_update'
5364 resources(execute: apt_get_update) rescue execute apt_get_update do
5465 command 'apt-get update'
@@ -68,7 +79,7 @@ when 'ubuntu'
6879 echo "deb http://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/ /" > /etc/apt/sources.list.d/kata-containers.list
6980 EOH
7081 action :nothing
71- not_if { File.exist?('/etc/apt/sources.list.d/kata-containers.list') }
82+ not_if { File.exist?('/etc/apt/sources.list.d/kata-containers.list') } unless node['kata-containers']['repo']['update']
7283 notifies :run, 'bash[add_kata-containers_apt_key]', :before
7384 notifies :run, "execute[#{apt_get_update}]", :immediately
7485 end
--- a/cookbooks/kata-containers/version
+++ b/cookbooks/kata-containers/version
@@ -1 +1 @@
1-0.2.1
1+0.3.0
--- /dev/null
+++ b/nodes/local-kata-containers.json
@@ -0,0 +1,5 @@
1+{
2+ "run_list": [
3+ "role[kata-containers]"
4+ ]
5+}
--- /dev/null
+++ b/roles/kata-containers.rb
@@ -0,0 +1,41 @@
1+#
2+# Copyright 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 'kata-containers'
18+description 'Kata Containers'
19+
20+run_list(
21+ 'recipe[kata-containers::default]',
22+ # with docker-grid cookbook
23+ #'recipe[docker-grid::engine]',
24+)
25+
26+#env_run_lists
27+
28+default_attributes(
29+)
30+
31+override_attributes(
32+ # with docker-grid cookbook
33+ 'docker-grid' => {
34+ 'engine' => {
35+ 'daemon_extra_options' => [
36+ '--add-runtime kata-runtime=/usr/bin/kata-runtime',
37+ '--default-runtime=kata-runtime',
38+ ].join(' '),
39+ },
40+ },
41+)
旧リポジトリブラウザで表示