diff --git a/roles/accounts/tasks/account.yml b/roles/accounts/tasks/account.yml index 942faf2..2ae3e6f 100644 --- a/roles/accounts/tasks/account.yml +++ b/roles/accounts/tasks/account.yml @@ -22,6 +22,14 @@ loop_control: loop_var: file +- name: Initialise {{ ssd }}/{{ user }} folder + file: + path: "{{ ssd }}/{{ user }}" + state: directory + group: "{{ user }}" + owner: "{{ user }}" + when: "service and ssd is defined" + - name: Copy SSH key of user {{ user }} authorized_key: user: "{{ user }}" diff --git a/roles/accounts/tasks/main.yml b/roles/accounts/tasks/main.yml index 16fd9fc..7f2e74e 100644 --- a/roles/accounts/tasks/main.yml +++ b/roles/accounts/tasks/main.yml @@ -2,6 +2,7 @@ - name: Set accounts include_tasks: account.yml vars: + service: "{{ item.value.service | default(false) }}" uid: "{{ item.value.uid | default(omit) }}" user: "{{ item.user }}" workspace: "{{ '/data/project' if item.value.service | default(false) else '/home' }}"