]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Support OpenSUSE Leap static slaves too 1570/head
authorDavid Galloway <dgallowa@redhat.com>
Fri, 15 May 2020 13:36:32 +0000 (09:36 -0400)
committerDavid Galloway <dgallowa@redhat.com>
Fri, 15 May 2020 13:36:32 +0000 (09:36 -0400)
These variables should be passed on the command line when configuring or reconfiguring a static Jenkins slave.

Signed-off-by: David Galloway <dgallowa@redhat.com>
ansible/examples/slave_static.yml

index 70717b7f5d00263f9f79fd3b938a0664a05f5cbb..f32f7f4ca372ffd2fdabfd5003c0acce0bf8c2c6 100644 (file)
@@ -28,6 +28,8 @@
    - nodename: '{{ ansible_hostname }}'
    - labels: '{{ labels }}'
    - use_jnlp: true
+   - osc_user: 'username'
+   - osc_pass: 'password'
 
   tasks:
     - name: create a {{ jenkins_user }} user
     - name: ensure the build dir exists
       file: path=/home/{{ jenkins_user }}/build state=directory owner={{ jenkins_user }}
 
+    - name: Create .config/osc directory
+      file:
+        path: "/home/{{ jenkins_user }}/.config/osc"
+        state: directory
+        owner: "{{ jenkins_user }}"
+      when: ansible_pkg_mgr  == "zypper"
+
+    - name: Add oscrc file
+      blockinfile:
+        create: yes
+        block: |
+          [general]
+          apiurl = https://api.opensuse.org
+          #build-root = /var/tmp/build-root/%(repo)s-%{arch)s
+
+          [https://api.opensuse.org]
+          user = {{ osc_user }}
+          pass = {{ osc_pass }}
+
+        path: "/home/{{ jenkins_user }}/.config/osc/oscrc"
+      become_user: "{{ jenkins_user }}"
+      when: ansible_pkg_mgr  == "zypper"
+
     - name: ensure the home dir has the right owner permissions
       file: path=/home/{{ jenkins_user }} state=directory owner={{ jenkins_user }} group={{ jenkins_user }} recurse=yes follow=no