2015-08-27 17:14:27 +02:00
|
|
|
---
|
2017-04-19 19:19:59 +02:00
|
|
|
- name: Create the dnet user, if it is not used to run the tomcat instances
|
|
|
|
user: name={{ dnet_user }} home={{ dnet_data_directory }} createhome=no shell=/bin/false
|
2017-05-16 17:57:23 +02:00
|
|
|
when: dnet_user != dnet_tomcat_user
|
2017-04-19 19:19:59 +02:00
|
|
|
tags: [ 'dnet', 'users' ]
|
|
|
|
|
2015-08-27 17:14:27 +02:00
|
|
|
- name: Add the dnet groups, if it does not exist already
|
|
|
|
group: name={{ item }} state=present
|
|
|
|
with_items:
|
|
|
|
- '{{ dnet_group }}'
|
|
|
|
- '{{ dnet_sudoers_group }}'
|
|
|
|
tags: [ 'dnet', 'users' ]
|
|
|
|
|
|
|
|
- name: Add all the users to the dnet group
|
|
|
|
user: name={{ item.login }} groups={{ dnet_group }}, append=yes
|
2016-03-24 15:41:14 +01:00
|
|
|
with_items: '{{ users_system_users | default([]) }}'
|
2015-08-27 17:14:27 +02:00
|
|
|
tags: [ 'dnet', 'users' ]
|
|
|
|
|
|
|
|
- name: Add selected users to the dnet sudoers group
|
|
|
|
user: name={{ item.login }} groups={{ dnet_sudoers_group }}, append=yes
|
2016-03-24 15:41:14 +01:00
|
|
|
with_items: '{{ users_system_users | default([]) }}'
|
2015-08-27 17:14:27 +02:00
|
|
|
when: item.dnet_sudoers_user
|
|
|
|
tags: [ 'dnet', 'users' ]
|
|
|
|
|
|
|
|
- name: Remove selected users to the dnet sudoers group
|
|
|
|
user: name={{ item.login }} groups={{ dnet_group }}
|
2016-03-24 15:41:14 +01:00
|
|
|
with_items: '{{ users_system_users | default([]) }}'
|
2015-08-27 17:14:27 +02:00
|
|
|
when: not item.dnet_sudoers_user
|
|
|
|
tags: [ 'dnet', 'users' ]
|
|
|
|
|