From 90aede8794eb7cbde5a4ef2e6e8c9fa5aaea60a8 Mon Sep 17 00:00:00 2001 From: Andrea Frittoli Date: Fri, 22 Sep 2017 13:22:34 +0100 Subject: [PATCH] Create stack home folder The create stack user role creates the home for the stack user, which works as long as the containing folder already exists. Since this may not always be the case, create the folder first. Change-Id: Ibe3539a738340d6e4d95e3661bca5e2067e3e959 --- roles/setup-stack-user/tasks/main.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/setup-stack-user/tasks/main.yaml b/roles/setup-stack-user/tasks/main.yaml index cc48d9ad..8384515e 100644 --- a/roles/setup-stack-user/tasks/main.yaml +++ b/roles/setup-stack-user/tasks/main.yaml @@ -3,6 +3,16 @@ name: stack become: yes +# NOTE(andreaf) Create a user home_dir is not safe via +# the user module since it will fail if the containing +# folder does not exists. If the folder does exists and +# it's empty, the skeleton is setup and ownership set. +- name: Create the stack user home folder + file: + path: '{{ devstack_stack_home_dir }}' + state: directory + become: yes + - name: Create stack user user: name: stack