]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
use lineinfile to get jenkins-build permissions
authorAlfredo Deza <adeza@redhat.com>
Fri, 17 Jul 2015 20:01:42 +0000 (16:01 -0400)
committerAlfredo Deza <adeza@redhat.com>
Fri, 17 Jul 2015 21:23:27 +0000 (17:23 -0400)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ansible/slaves/slave.yml

index 70954a77daf79a0d46ff87b4409fa94ad1243269..773edb79709bc243cc74a1597ae18b8ebc0e9786 100644 (file)
     - name: jenkins api key should be present
       copy: src=files/jenkins_jobs.ini dest=/etc/jenkins_jobs/jenkins_jobs.ini
 
-    # FIXME: this needs line_in_file with validation, that has:
-    # jenkins-build   ALL=(ALL:ALL) NOPASSWD:ALL
-    # Copy a new "sudoers" file into place, after passing validation with visudo
-    # - copy: src=files/sudoers dest=/etc/sudoers validate='visudo -cf %s'
+    - name: ensure the build dir exists
+      sudo: yes
+      lineinfile:
+        dest: /etc/sudoers
+        regexp: '^jenkins-build ALL'
+        line: 'jenkins-build   ALL=(ALL:ALL) NOPASSWD:ALL'
+        backrefs: yes
+        validate: 'visudo -cf %s'
 
     - name: ensure the build dir exists
       file: path=/home/{{ jenkins_user }}/build state=directory owner={{ jenkins_user }}