From: Tom Hughes Date: Tue, 24 Mar 2020 19:23:39 +0000 (+0000) Subject: Add test for docker cookbook X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/ebe7ceb136d38c41bcc193b93bb2f619ffe61944 Add test for docker cookbook --- diff --git a/.github/workflows/test-kitchen.yml b/.github/workflows/test-kitchen.yml index 86cf5fb42..99353fd3f 100644 --- a/.github/workflows/test-kitchen.yml +++ b/.github/workflows/test-kitchen.yml @@ -25,6 +25,7 @@ jobs: - devices - dhcpd - dmca + - docker - donate - elasticsearch - exim diff --git a/.kitchen.yml b/.kitchen.yml index 994885126..05d70d470 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -90,6 +90,9 @@ suites: - name: dmca run_list: - recipe[dmca::default] + - name: docker + run_list: + - recipe[docker::default] - name: donate run_list: - recipe[donate::default] diff --git a/cookbooks/docker/metadata.rb b/cookbooks/docker/metadata.rb index 0c9cc8660..110cc3202 100644 --- a/cookbooks/docker/metadata.rb +++ b/cookbooks/docker/metadata.rb @@ -6,3 +6,4 @@ description "Installs and configures the docker daemon" version "1.0.0" supports "ubuntu" +depends "apt" diff --git a/cookbooks/docker/recipes/default.rb b/cookbooks/docker/recipes/default.rb index fd3773634..54d65dfe5 100644 --- a/cookbooks/docker/recipes/default.rb +++ b/cookbooks/docker/recipes/default.rb @@ -17,14 +17,20 @@ # limitations under the License. # +include_recipe "apt" + package %w[ - apt-transport-https - ca-certificates - curl - software-properties-common - gnupg2 + docker-ce + docker-ce-cli + containerd.io ] +directory "/etc/docker" do + owner "root" + group "root" + mode 0o755 +end + template "/etc/docker/daemon.json" do source "daemon.json.erb" owner "root" @@ -32,13 +38,8 @@ template "/etc/docker/daemon.json" do mode 0o644 end -package %w[ - docker-ce - docker-ce-cli - containerd.io -] - service "docker" do action [:enable, :start] subscribes :restart, "template[/etc/docker/daemon.json]" + not_if { ENV["TEST_KITCHEN"] } end