]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ensure that rpmmacros is set when building centos slaves
authorAlfredo Deza <adeza@redhat.com>
Thu, 5 Nov 2015 20:44:16 +0000 (15:44 -0500)
committerAlfredo Deza <adeza@redhat.com>
Thu, 5 Nov 2015 20:52:34 +0000 (15:52 -0500)
Signed-off-by: Alfredo Deza <adeza@redhat.com>
ansible/slave.yml

index 95d9081cc2bbfbe902a001c34842f5bb83457216..3016dd76a5aefadcfee5ecdac2a291f6a949569d 100644 (file)
@@ -7,10 +7,10 @@
    - jenkins_user: 'jenkins-build'
   tasks:
     - name: create a jenkins-build user
-      user: name=jenkins-build comment="Jenkins Build Slave User"
+      user: name=jenkins-build comment="Jenkins Build Slave User" home="/home/{{ jenkins_user }}"
 
     - name: Create .ssh directory
-      file: path=/home/jenkins-build/.ssh
+      file: path=/home/{{ jenkins_user }}/.ssh
             state=directory
 
     - name: set the authorized keys
         #- rpm-sign
       when: ansible_pkg_mgr  == "yum"
 
+    - name: ensure the rpmmacros file exists to fix centos builds
+      template:
+         src: files/rpmmacros.j2
+         dest: "/home/{{ jenkins_user }}/.rpmmacros"
+         owner: "{{ jenkins_user }}"
+      when: ansible_pkg_mgr  == "yum"
+
     # Run the equivalent of "apt-get update" as a separate step
     - apt: update_cache=yes
       when: ansible_pkg_mgr  == "apt"
 
     - name: add docs.ceph.com host key
       sudo: true
-      known_hosts: path='/etc/ssh/ssh_known_hosts'
-      name='docs.ceph.com'
-      # docs.ceph.com.pub is the output of `ssh-keyscan docs.ceph.com`
-      key="{{ lookup('file', 'ssh/hostkeys/docs.ceph.com.pub') }}"
+      known_hosts:
+        path: '/etc/ssh/ssh_known_hosts'
+        name: 'docs.ceph.com'
+        # docs.ceph.com.pub is the output of `ssh-keyscan docs.ceph.com`
+        key: "{{ lookup('file', 'ssh/hostkeys/docs.ceph.com.pub') }}"
 
     - name: register the new slave to jenkins master
       jenkins-node: