• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: Commit

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


Commit MetaInfo

Revisionfcf76a668e56de723562a9edab5953916409eaa6 (tree)
Time2018-09-23 16:39:05
Authorwhitestar <whitestar@user...>
Commiterwhitestar

Log Message

adds the latest Ubuntu support.

Change Summary

Incremental Difference

--- a/cookbooks/docker-grid/CHANGELOG.md
+++ b/cookbooks/docker-grid/CHANGELOG.md
@@ -1,5 +1,9 @@
11 # docker-grid CHANGELOG
22
3+1.3.2
4+-----
5+- adds the latest Ubuntu support.
6+
37 1.3.1
48 -----
59 - removes an extra attribute.
--- a/cookbooks/docker-grid/recipes/engine.rb
+++ b/cookbooks/docker-grid/recipes/engine.rb
@@ -287,6 +287,7 @@ when 'debian'
287287 owner 'root'
288288 group 'root'
289289 mode '0644'
290+ helpers Chef::Mixin::ShellOut
290291 notifies :run, 'bash[apt-key_adv_docker_tools_key]', :before
291292 notifies :run, "execute[#{apt_get_update}]", :immediately
292293 end
--- a/cookbooks/docker-grid/templates/default/etc/apt/sources.list.d/docker.list
+++ b/cookbooks/docker-grid/templates/default/etc/apt/sources.list.d/docker.list
@@ -14,13 +14,35 @@ if !override_apt_line.nil? && !override_apt_line.empty?
1414 <%= override_apt_line %>
1515 <%
1616 else
17+ apt_repo_url = node['docker-grid']['apt_repo']['url']
18+
1719 if enable_new_repo
20+ codename = node['lsb']['codename']
21+ codename = +codename # unfreeze
22+
23+ # for the latest Ubuntu
24+ if node['platform'] == 'ubuntu'
25+ lap_behind = ['trusty', 'xenial', 'yakkety', 'zesty']
26+ result = shell_out!(%q(curl -sS https://download.docker.com/linux/ubuntu/dists/ | awk -F'</?a[^>]*>' '/<\/a>/ {print $2}' | tr -d / | grep -v '\.\.' | sort))
27+ codenames = result.stdout.chomp.split("\n") if result.exitstatus.zero? && !result.stdout.chomp.empty?
28+ if codenames.include?(codename)
29+ Chef::Log.info("Ubuntu #{codename} is supported by the dockerproject.")
30+ else
31+ codenames.reverse_each {|cn|
32+ next if lap_behind.include?(cn)
33+
34+ Chef::Log.warn("Ubuntu #{codename} is not supported by the dockerproject yet, use #{cn} repository instead.")
35+ codename = cn # latest codename
36+ break
37+ }
38+ end
39+ end
1840 -%>
19-deb [arch=<%= arch %>] <%= node['docker-grid']['apt_repo']['url'] %> <%= node['lsb']['codename'] %> <%= node['docker-grid']['dockerproject']['apt_new_repo_sections'] %>
41+deb [arch=<%= arch %>] <%= apt_repo_url %> <%= codename %> <%= node['docker-grid']['dockerproject']['apt_new_repo_sections'] %>
2042 <%
2143 else
2244 -%>
23-deb <%= node['docker-grid']['apt_repo']['url'] %> <%= platform %>-<%= node['lsb']['codename'] %> main
45+deb <%= apt_repo_url %> <%= platform %>-<%= codename %> main
2446 <%
2547 end
2648 end
--- a/cookbooks/docker-grid/version
+++ b/cookbooks/docker-grid/version
@@ -1 +1 @@
1-1.3.1
1+1.3.2
--- a/roles/docker4latest_ubuntu.rb
+++ b/roles/docker4latest_ubuntu.rb
@@ -1,5 +1,5 @@
11 #
2-# Copyright 2016-2017, whitestar
2+# Copyright 2016-2018, whitestar
33 #
44 # Licensed under the Apache License, Version 2.0 (the "License");
55 # you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515 #
1616
1717 name 'docker4latest_ubuntu'
18-description 'Docker for the latest Ubuntu'
18+description '*DEPRECATED* Docker for the latest Ubuntu'
1919
2020 run_list(
2121 'role[docker]',
@@ -36,8 +36,8 @@ override_attributes(
3636 'apt_repo' => {
3737 # new repo.
3838 # Check https://download.docker.com/linux/ubuntu/dists
39- 'override_apt_line' => 'deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable',
40- #'override_apt_line' => 'deb [arch=amd64] https://download.docker.com/linux/ubuntu zesty stable',
39+ 'override_apt_line' => 'deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable',
40+ #'override_apt_line' => 'deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable',
4141 # old repo.
4242 #'override_apt_line' => 'deb https://apt.dockerproject.org/repo ubuntu-zesty main',
4343 #'override_apt_line' => 'deb https://apt.dockerproject.org/repo ubuntu-xenial main',
Show on old repository browser