From fbf32b1342cfd053b229051a02799ff4557b6394 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Wed, 18 Dec 2019 15:57:21 -0500 Subject: [PATCH] ansible: Support Ubuntu Bionic slaves https://askubuntu.com/a/381527/906620 Signed-off-by: David Galloway --- ansible/examples/slave.yml | 21 +++++++++++++++++++-- ansible/examples/slave_static.yml | 28 +++++++++++++++++++++++----- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/ansible/examples/slave.yml b/ansible/examples/slave.yml index 2a772bdd..e749e051 100644 --- a/ansible/examples/slave.yml +++ b/ansible/examples/slave.yml @@ -281,7 +281,7 @@ update_cache: yes when: ansible_pkg_mgr == "apt" - - name: Install DEB requirements + - name: Install universal DEB requirements apt: name: "{{ item }}" state: present @@ -291,7 +291,6 @@ - fakeroot-ng - debhelper - reprepro - - dchroot - devscripts - pbuilder - pkg-config @@ -313,6 +312,24 @@ - 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 diff --git a/ansible/examples/slave_static.yml b/ansible/examples/slave_static.yml index 23de51d8..b548f987 100644 --- a/ansible/examples/slave_static.yml +++ b/ansible/examples/slave_static.yml @@ -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 @@ -185,16 +185,16 @@ - 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 @@ -218,6 +218,24 @@ - 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" -- 2.39.5