devstack/roles/setup-stack-user/tasks/main.yaml
Andrea Frittoli acca80414f Ensure that stack home is owned by stack
The role that sets up the user and its home folder must ensure that
the home folder is owned by stack as well.

Change-Id: I2e72d7b9d68a2a14f8a148ef82cbb3f569bd1cea
2018-03-03 22:16:50 +00:00

48 lines
1.0 KiB
YAML

- name: Create stack group
group:
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
shell: /bin/bash
home: '{{ devstack_stack_home_dir }}'
group: stack
become: yes
- name: Set stack user home directory permissions and ownership
file:
path: '{{ devstack_stack_home_dir }}'
mode: 0755
owner: stack
group: stack
become: yes
- name: Copy 50_stack_sh file to /etc/sudoers.d
copy:
src: 50_stack_sh
dest: /etc/sudoers.d
mode: 0440
owner: root
group: root
become: yes
- name: Create .cache folder within BASE
file:
path: '{{ devstack_stack_home_dir }}/.cache'
state: directory
owner: stack
group: stack
become: yes