From f17ef0d2e102c808a317580a653a3265df6ba967 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 10 Nov 2016 14:04:14 +0100 Subject: [PATCH] library/roles/d4s_user_services_perms: Change the gcore task to handle the case of multiple users. d4science-ghn-cluster/group_vars/ghn_d4research: The collector needs two users. --- d4s_user_services_perms/defaults/main.yml | 1 + d4s_user_services_perms/tasks/d4s-basic-node.yml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/d4s_user_services_perms/defaults/main.yml b/d4s_user_services_perms/defaults/main.yml index fbe3330..ab857e8 100644 --- a/d4s_user_services_perms/defaults/main.yml +++ b/d4s_user_services_perms/defaults/main.yml @@ -7,6 +7,7 @@ d4s_service_node: False smartgears_node: False d4s_tomcat_node: False gcore_node: False +gcore_multiple_users: False d4science_sudoers_commands: - /etc/init.d/tomcat-instance-* diff --git a/d4s_user_services_perms/tasks/d4s-basic-node.yml b/d4s_user_services_perms/tasks/d4s-basic-node.yml index f9dd124..4ef9605 100644 --- a/d4s_user_services_perms/tasks/d4s-basic-node.yml +++ b/d4s_user_services_perms/tasks/d4s-basic-node.yml @@ -1,6 +1,12 @@ --- - name: Create the d4science user user: name={{ d4science_user }} home={{ d4science_user_home }} createhome={{ d4science_user_create_home }} shell={{ d4science_user_shell }} + when: not gcore_multiple_users tags: [ 'gcore', 'd4science', 'users' ] +- name: Create the d4science users + user: name={{ item }} home=/home/{{ item }} createhome={{ d4science_user_create_home }} shell={{ d4science_user_shell }} + with_items: '{{ gcore_users | default([]) }}' + when: gcore_multiple_users + tags: [ 'gcore', 'd4science', 'users' ]