From: David Galloway Date: Thu, 28 Jul 2016 21:56:19 +0000 (-0400) Subject: teuthology: Create test-admins group and grant test_admins right to run `kill` X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=adbe232253ab5327435f1c6c8e630dbf5dc787b6;p=ceph-cm-ansible.git teuthology: Create test-admins group and grant test_admins right to run `kill` Fixes: http://tracker.ceph.com/issues/16614 Signed-off-by: David Galloway --- diff --git a/roles/teuthology/tasks/setup_users.yml b/roles/teuthology/tasks/setup_users.yml index 7ac0f30b..f1642624 100644 --- a/roles/teuthology/tasks/setup_users.yml +++ b/roles/teuthology/tasks/setup_users.yml @@ -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 }}"