From adbe232253ab5327435f1c6c8e630dbf5dc787b6 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 28 Jul 2016 17:56:19 -0400 Subject: [PATCH] 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 --- roles/teuthology/tasks/setup_users.yml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 }}" -- 2.47.3