From 4e559edbf5059d5cf00904f9f06aca0b961abdac Mon Sep 17 00:00:00 2001
From: Ian Wienand <iwienand@redhat.com>
Date: Thu, 10 Jun 2021 08:39:28 +1000
Subject: [PATCH] nodepool-builder: add volume for /var/lib/containers

podman, used by the new containerfile element, requires a
non-overlayfs volume at /var/lib/containers to be able to start and
extract the container images for us to build from.  Add a separate
volume for this.

Change-Id: I6629034ad0b300d392d3d989dbbf17a1343c06e1
---
 playbooks/roles/nodepool-builder/tasks/main.yaml              | 1 +
 .../roles/nodepool-builder/templates/docker-compose.yaml.j2   | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/playbooks/roles/nodepool-builder/tasks/main.yaml b/playbooks/roles/nodepool-builder/tasks/main.yaml
index 9be56b323d..9bbfa4bacd 100644
--- a/playbooks/roles/nodepool-builder/tasks/main.yaml
+++ b/playbooks/roles/nodepool-builder/tasks/main.yaml
@@ -13,6 +13,7 @@
   loop:
     - '/opt/dib_tmp'
     - '/opt/dib_cache'
+    - '/opt/dib_containers'
     - '/opt/nodepool_dib'
     - '/var/log/nodepool/builds'
 
diff --git a/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2 b/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2
index 0fa7f3c24e..5ac6ca8a40 100644
--- a/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2
+++ b/playbooks/roles/nodepool-builder/templates/docker-compose.yaml.j2
@@ -1,4 +1,5 @@
 version: '2'
+
 services:
   nodepool-builder:
     image: docker.io/zuul/nodepool-builder:{{ nodepool_builder_container_tag|default('latest') }}
@@ -30,3 +31,6 @@ services:
       - /opt/nodepool_dib:/opt/nodepool_dib:rw
       # logs (builder + dib build logs under /build)
       - /var/log/nodepool:/var/log/nodepool:rw
+      # for the containerfile element/podman; it needs a non-overlayfs
+      # mounted here.
+      - /opt/dib_containers:/var/lib/containers