# kata-containers CHANGELOG
+0.3.0
+-----
+- add repository update flag
+
0.2.1
-----
- update documents.
|Key|Type|Description, example|Default|
|:--|:--|:--|:--|
+|`['kata-containers']['repo']['update']`|Boolean|Repository update flag.|`false`|
## Usage
--- /dev/null
+#
+# Cookbook Name:: kata-containers
+# Attributes:: default
+#
+# Copyright 2018, 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.
+#
+
+default['kata-containers']['repo']['update'] = false
bash 'add_kata-containers_repo' do
code <<-"EOH"
source /etc/os-release
+ if [ -f /etc/yum.repos.d/*katacontainers*.repo ]; then
+ rm /etc/yum.repos.d/*katacontainers*.repo
+ fi
yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/release/CentOS_${VERSION_ID}/home:katacontainers:release.repo"
EOH
action :nothing
- not_if "yum repolist | grep 'katacontainers'"
+ not_if "yum repolist | grep 'katacontainers'" unless node['kata-containers']['repo']['update']
end
[
end
}
when 'ubuntu'
+ [
+ 'curl',
+ ].each {|pkg_name|
+ resources(package: pkg_name) rescue package pkg_name do
+ action :install
+ end
+ }
+
apt_get_update = 'apt-get_update'
resources(execute: apt_get_update) rescue execute apt_get_update do
command 'apt-get update'
echo "deb http://download.opensuse.org/repositories/home:/katacontainers:/release/xUbuntu_$(lsb_release -rs)/ /" > /etc/apt/sources.list.d/kata-containers.list
EOH
action :nothing
- not_if { File.exist?('/etc/apt/sources.list.d/kata-containers.list') }
+ not_if { File.exist?('/etc/apt/sources.list.d/kata-containers.list') } unless node['kata-containers']['repo']['update']
notifies :run, 'bash[add_kata-containers_apt_key]', :before
notifies :run, "execute[#{apt_get_update}]", :immediately
end
--- /dev/null
+{
+ "run_list": [
+ "role[kata-containers]"
+ ]
+}
--- /dev/null
+#
+# Copyright 2018, 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 'kata-containers'
+description 'Kata Containers'
+
+run_list(
+ 'recipe[kata-containers::default]',
+ # with docker-grid cookbook
+ #'recipe[docker-grid::engine]',
+)
+
+#env_run_lists
+
+default_attributes(
+)
+
+override_attributes(
+ # with docker-grid cookbook
+ 'docker-grid' => {
+ 'engine' => {
+ 'daemon_extra_options' => [
+ '--add-runtime kata-runtime=/usr/bin/kata-runtime',
+ '--default-runtime=kata-runtime',
+ ].join(' '),
+ },
+ },
+)