]> git.apps.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ansible: Support Ubuntu Bionic slaves
authorDavid Galloway <dgallowa@redhat.com>
Wed, 18 Dec 2019 20:57:21 +0000 (15:57 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Wed, 18 Dec 2019 21:03:39 +0000 (16:03 -0500)
https://askubuntu.com/a/381527/906620

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

index 2a772bdd6e94e1cbe878d6e47847c8cd2b80c50c..e749e0515640a285b6946aa0be778cf1ccd55f3e 100644 (file)
         update_cache: yes
       when: ansible_pkg_mgr  == "apt"
 
-    - name: Install DEB requirements
+    - name: Install universal DEB requirements
       apt:
         name: "{{ item }}"
         state: present
         - fakeroot-ng
         - debhelper
         - reprepro
-        - dchroot
         - devscripts
         - pbuilder
         - pkg-config
         - ant
       when: ansible_pkg_mgr  == "apt"
 
+    # For now schroot/dchroot are the only package differences.  This may change.
+    # Just change this to be a list if that happens.
+    - name: Install DEB requirements (>=18.04)
+      apt:
+        name: schroot
+        state: present
+      when:
+        - ansible_pkg_mgr  == "apt"
+        - ansible_distribution_major_version|int >= 18
+
+    - name: Install DEB requirements (<=16.04)
+      apt:
+        name: dchroot
+        state: present
+      when:
+        - ansible_pkg_mgr  == "apt"
+        - ansible_distribution_major_version|int <= 16
+
     - name: Add the Debian Jessie Key
       apt_key:
        id: 2B90D010
index 23de51d89b85a70e88a3e1d8f9622ffb1991c399..b548f98748dc4b028980f92756c55f5a6ec61e8e 100644 (file)
@@ -2,7 +2,7 @@
 # This playbook is used to configure static jenkins slaves. It uses
 # a hosts file so that nodename can be set per host.
 #
-# install python2.7 on xenial nodes
+# install python2.7 on Ubuntu
 - hosts: all
   become: yes
 # this will most likely need changed
     - apt: update_cache=yes
       when: ansible_pkg_mgr  == "apt"
 
-    - name: Install DEB requirements
-      become: yes
-      apt: name={{ item }} state=present
+    - name: Install universal DEB requirements
+      apt:
+        name: "{{ item }}"
+        state: present
       with_items:
         - git
         - fakeroot
         - fakeroot-ng
         - debhelper
         - reprepro
-        - dchroot
         - devscripts
         - pbuilder
         - pkg-config
         - curl
       when: ansible_pkg_mgr  == "apt"
 
+    # For now schroot/dchroot are the only package differences.  This may change.
+    # Just change this to be a list if that happens.
+    - name: Install DEB requirements (>=18.04)
+      apt:
+        name: schroot
+        state: present
+      when:
+        - ansible_pkg_mgr  == "apt"
+        - ansible_distribution_major_version|int >= 18
+
+    - name: Install DEB requirements (<=16.04)
+      apt:
+        name: dchroot
+        state: present
+      when:
+        - ansible_pkg_mgr  == "apt"
+        - ansible_distribution_major_version|int <= 16
+
     - name: Add the Debian Jessie Key
       become: yes
       when: ansible_pkg_mgr  == "apt"