ansible-role-user_services_.../tasks/common-users-data-dirs.yml

64 lines
2.5 KiB
YAML
Raw Normal View History

2020-05-28 16:46:43 +02:00
---
- block:
- name: Create the common group used to setup acls
group: name={{ common_users_group }} state=present system=yes
when: additional_data_directories is defined
tags: [ 'users', 'users_acl' ]
- block:
- name: Add selected users to the commong group
user: name={{ item.login }} groups={{ common_users_group }} append=yes
with_items: '{{ users_system_users }}'
when: users_system_users is defined
tags: [ 'users', 'users_acl' ]
- block:
- name: Add additional users to the commong group
user: name={{ item.login }} groups={{ common_users_group }} append=yes
with_items: '{{ users_system_users_adjunct }}'
when: users_system_users_adjunct is defined
tags: [ 'users', 'users_acl' ]
- block:
- name: Create the users additional data dirs
file: name={{ item.name }} state=directory owner={{ item.owner }} group={{ item.group }} mode={{ item.perms }}
with_items: '{{ additional_data_directories }}'
when: item.create and not item.file
tags: [ 'users', 'users_acl' ]
- block:
- name: Create more additional data dirs
file: name={{ item.name }} state=directory owner={{ item.owner }} group={{ item.group }} mode={{ item.perms }}
with_items: '{{ additional_data_directories_adjunct }}'
when: item.create and not item.file
tags: [ 'users', 'users_acl' ]
- block:
- name: Set the read/write/access permissions on the users additional data dirs
acl: name={{ item.name }} entity={{ common_users_group }} etype=group permissions={{ item.aclperms | default('rwX') }} state=present recursive=yes
with_items: '{{ additional_data_directories }}'
- name: Set the default read/write/access permissions on the users additional data dirs
acl: name={{ item.name }} entity={{ common_users_group }} etype=group permissions={{ item.aclperms | default('rwX') }} state=present default=yes recursive=yes
with_items: '{{ additional_data_directories }}'
tags: [ 'users_acl' ]
- block:
- name: Set the read/write/access permissions on the additional data dirs
acl: name={{ item.name }} entity={{ common_users_group }} etype=group permissions={{ item.aclperms | default('rwX') }} state=present recursive=yes
with_items: '{{ additional_data_directories_adjunct }}'
- name: Set the default read/write/access permissions on the additional data dirs
acl: name={{ item.name }} entity={{ common_users_group }} etype=group permissions={{ item.aclperms | default('rwX') }} state=present default=yes recursive=yes
with_items: '{{ additional_data_directories_adjunct }}'
tags: [ 'users_acl' ]