From 141249c6a1fdc403a2d1ed8660d8288109da2b7b Mon Sep 17 00:00:00 2001 From: ToivoS <38542384+ToivoS@users.noreply.github.com> Date: Fri, 16 Oct 2020 13:49:18 +0100 Subject: [PATCH] fix xdg issue (#289) * fix xdg issue * fix * fix * sudo rights Co-authored-by: Fotios Papadopoulos --- .../common/docker-container/tasks/reinstall.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ansible/roles/products/common/docker-container/tasks/reinstall.yml b/ansible/roles/products/common/docker-container/tasks/reinstall.yml index 1d829d9db..3a3a40299 100644 --- a/ansible/roles/products/common/docker-container/tasks/reinstall.yml +++ b/ansible/roles/products/common/docker-container/tasks/reinstall.yml @@ -4,6 +4,11 @@ path: "{{ shadow_hand_launcher_folder }}" state: directory +- name: Check if /run/user/1000 folder exists in the docker image + shell: "docker image history --no-trunc {{ full_image_name }} | grep XDG_RUNTIME_DIR | wc -l" + register: xdg_check + changed_when: false + - name: Creating the container which will execute setup script in terminator when started when: "not nvidia_docker|bool and terminator and setup_script | length > 0" include_tasks: create-container/with-setup-with-terminator.yml @@ -24,6 +29,13 @@ when: "nvidia_docker|bool and terminator and setup_script | length > 0" include_tasks: create-container/nvidia-with-setup-with-terminator.yml +- name: if run/user/1000 doesn't exist, then create it inside the container + import_tasks: modify-container.yml + vars: + modify_script_name: "create_run_user_1000.sh" + modify_script_commands: "sudo mkdir -p /run/user/1000;sudo chmod 0700 /run/user/1000;sudo chown 1000:1000 /run/user/1000;export XDG_RUNTIME_DIR=/run/user/1000" + when: xdg_check.stdout=="0" + - name: Checking out PRs and branches if pr_branches list has been specified block: - name: Creating the pull_pr_branches_and_catkin_make bash script for testing for these branches {{ pr_branches }}