]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
users: creates users with sudo access and users without. 23/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 6 May 2015 20:18:00 +0000 (15:18 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 6 May 2015 20:20:57 +0000 (15:20 -0500)
Introduces a new list of users, managed_admin_users, which are given
sudo access.  The existing list, managed_users, are not not given sudo
access.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/users/defaults/main.yml
roles/users/tasks/main.yml

index 09aa806f1ca9ba29bfa44e04627f25463c4277d0..545fd5ab921db918d1f668a3c4ebf52cf13752f5 100644 (file)
@@ -8,4 +8,7 @@
 #     - name: user2
 #       key: <url to an ssh key>
 
+# not given sudo access
 managed_users: []
+# are given sudo access
+managed_admin_users: []
index 2c02f2bcedec19bf099352506c7c2b06e3784037..c1aa85b4951a7862d552486363be4ef3966c1655 100644 (file)
@@ -1,9 +1,17 @@
 ---
-- name: Create all users.
+- name: Create all admin users with sudo access.
   user:
     name: "{{ item.name }}"
     group: sudo
     state: present
+  with_items: managed_admin_users
+  tags:
+    - users
+
+- name: Create all users without sudo access.
+  user:
+    name: "{{ item.name }}"
+    state: present
   with_items: managed_users
   tags:
     - users
@@ -12,6 +20,6 @@
   authorized_key:
     user: "{{ item.name }}"
     key: "{{ item.key }}"
-  with_items: managed_users
+  with_items: managed_users|list + managed_admin_users|list
   tags:
     - pubkeys