]> git.openstreetmap.org Git - chef.git/commitdiff
Add test for docker cookbook
authorTom Hughes <tom@compton.nu>
Tue, 24 Mar 2020 19:23:39 +0000 (19:23 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 24 Mar 2020 19:28:34 +0000 (19:28 +0000)
.github/workflows/test-kitchen.yml
.kitchen.yml
cookbooks/docker/metadata.rb
cookbooks/docker/recipes/default.rb

index 86cf5fb423b0308a0b9b5353fa460554e1526806..99353fd3ff08f5aeeceba00b4c181a6236589f3d 100644 (file)
@@ -25,6 +25,7 @@ jobs:
           - devices
           - dhcpd
           - dmca
+          - docker
           - donate
           - elasticsearch
           - exim
index 994885126ed72373e9cbbbf43bf3bb1e68b5f23b..05d70d470133d6d076e81d9cc2af1cfe3c221769 100644 (file)
@@ -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]
index 0c9cc8660672132ba2c6921402c1016394560926..110cc32020e69ef10fb2927dfcb21b89a6d5f5b3 100644 (file)
@@ -6,3 +6,4 @@ description       "Installs and configures the docker daemon"
 
 version           "1.0.0"
 supports          "ubuntu"
+depends           "apt"
index fd3773634be177b2881d9e21e53dd7fe731207e0..54d65dfe588c098deb62cc34c3959a8b82c60d34 100644 (file)
 # 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