From b4dc66ec330d0056fdfa8e5226ec0d5b00ae0667 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 20 Mar 2020 13:28:03 -0700 Subject: [PATCH] use-buildset-registry: protect against /var/user/1000 not existing This is the case on Xenial; we'll just accept that podman and friends may not work there. Change-Id: Icd14e4502ff21640a1948671a475448adaf868f5 --- roles/use-buildset-registry/tasks/user-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/use-buildset-registry/tasks/user-config.yaml b/roles/use-buildset-registry/tasks/user-config.yaml index 238262fd5..b4c9eea61 100644 --- a/roles/use-buildset-registry/tasks/user-config.yaml +++ b/roles/use-buildset-registry/tasks/user-config.yaml @@ -37,10 +37,18 @@ content: "{{ docker_config | to_nice_json }}" dest: "~/.docker/config.json" mode: 0600 +# The next two tasks are for supporting the "containers" tools (ie, +# not docker); this directory doesn't exist on Xenial. +- name: Check if /run/user exists + stat: + path: "/run/user/{{ ansible_user_uid }}" + register: run_user - name: Write containers auth configuration + when: run_user.stat.exists copy: content: "{{ docker_config | to_nice_json }}" dest: "/run/user/{{ ansible_user_uid }}/auth.json" +# The next two tasks are for supporting k8s - name: Check if /var/lib/kubelet exists stat: path: /var/lib/kubelet