Allow the jenkins user to sudo as any user 25/63125/1
authorThanh Ha <zxiiro@gmail.com>
Fri, 14 Feb 2020 03:12:17 +0000 (22:12 -0500)
committerThanh Ha <zxiiro@gmail.com>
Fri, 14 Feb 2020 03:14:19 +0000 (22:14 -0500)
Previously the Jenkins user could only sudo and run commands as root.
This change allows the Jenkins user to `sudo -u another_user` without
providing a password. This is useful for test suites that need to
perform commands as different user accounts and not just root.

Change-Id: Ib7864e8b9370ae7f1a2a8bec82cf609e7dcccead
Signed-off-by: Thanh Ha <zxiiro@gmail.com>
provision/baseline.yaml

index 4108710..61673a5 100644 (file)
@@ -17,7 +17,7 @@
         dest: /etc/sudoers.d/89-jenkins-user-defaults
         content: |
           Defaults:jenkins !requiretty
-          jenkins ALL = NOPASSWD: ALL
+          jenkins ALL=(ALL) NOPASSWD:ALL
         validate: /usr/sbin/visudo -cf %s
       become: yes