]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
teuthology: Create test-admins group and grant test_admins right to run `kill` 272/head
authorDavid Galloway <dgallowa@redhat.com>
Thu, 28 Jul 2016 21:56:19 +0000 (17:56 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 4 Aug 2016 22:53:42 +0000 (18:53 -0400)
Fixes: http://tracker.ceph.com/issues/16614
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/teuthology/tasks/setup_users.yml

index 7ac0f30b033bb25877c395e72733e4d4d6fd7ba4..f16426248510e0040ffbe1205c10179b684a0344 100644 (file)
@@ -8,6 +8,34 @@
   tags:
     - user
 
+# test-admins group gets sudo rights to /bin/kill pids (used by teuthology-kill)
+- name: Create test-admins group
+  group:
+    name: test-admins
+    state: present
+  tags:
+    - user
+
+- name: Add test_admins to test-admins group
+  user:
+    name: "{{ item }}"
+    groups: test-admins
+    append: yes
+  with_items: "{{ test_admins }}"
+  tags:
+    - user
+  when: test_admins is defined and test_admins|length > 0
+
+- name: Grant test-admins sudo access to /bin/kill
+  lineinfile:
+    dest: /etc/sudoers.d/cephlab_sudo
+    regexp: "^%test-admins"
+    line: "%test-admins ALL=NOPASSWD: /bin/kill, /usr/bin/kill"
+    state: present
+    validate: visudo -cf %s
+  tags:
+    - user
+
 - name: Clone the teuthology repo
   git:
     repo: "{{ teuthology_repo }}"