ansible-roles/webapps/nextcloud/tasks/user.yml

39 lines
838 B
YAML
Raw Normal View History

2020-10-02 16:51:05 +02:00
---
- name: Create Nextcloud group
group:
name: "{{ nextcloud_instance_name | mandatory }}"
state: present
tags:
- nextcloud
- name: Create Nextcloud user
user:
name: "{{ nextcloud_user | mandatory }}"
group: "{{ nextcloud_user }}"
home: "{{ nextcloud_home | mandatory }}"
shell: '/bin/bash'
createhome: True
state: present
tags:
- nextcloud
- name: Add the user 'www-data' to Nextcloud group
user:
name: www-data
groups: "{{ nextcloud_user | mandatory }}"
append: yes
- name: Create top-level directories
file:
dest: "{{ item }}"
state: directory
mode: "0770"
owner: "{{ nextcloud_user }}"
group: "{{ nextcloud_user }}"
loop:
2020-10-02 16:51:05 +02:00
- "{{ nextcloud_home }}/log"
- "{{ nextcloud_home }}/tmp"
- "{{ nextcloud_home }}/data"
tags:
- nextcloud