From a960e83a6cca7ed4aa980232d7c69630e226cefb Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Fri, 21 Sep 2018 14:16:29 +0100 Subject: [PATCH] SUSE: Add support for openSUSE Leap 15 Change-Id: I7aaa59194dfe00a851c854728265c31d2dae5ca5 --- Vagrantfile | 15 +++++++ playbooks/openstack-hosts-setup.yml | 4 +- scripts/bootstrap-ansible.sh | 7 +-- .../tasks/check-requirements.yml | 4 +- .../bootstrap-host/tasks/prepare_hostname.yml | 14 +++++- zuul.d/jobs.yaml | 44 +++++++++++++++++++ zuul.d/project-templates.yaml | 10 +++++ 7 files changed, 89 insertions(+), 9 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index c9b01edeba..4a531031a6 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -80,4 +80,19 @@ Vagrant.configure(2) do |config| SHELL end + config.vm.define "opensuse150" do |leap150| + leap150.disksize.size = disk_size + leap150.vm.box = "opensuse/openSUSE-15.0-x86_64" + leap150.vm.provision "shell", + privileged: true, + inline: <<-SHELL + cd /vagrant + zypper -qn in gdisk + echo -e 'x\ne\nw\ny\n' | gdisk /dev/sda + parted -s /dev/sda unit GB resizepart 3 100% + btrfs fi resize max / + ./scripts/gate-check-commit.sh + SHELL + end + end diff --git a/playbooks/openstack-hosts-setup.yml b/playbooks/openstack-hosts-setup.yml index ad6073a794..d4aa3bf7a1 100644 --- a/playbooks/openstack-hosts-setup.yml +++ b/playbooks/openstack-hosts-setup.yml @@ -47,8 +47,8 @@ - (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial') or (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') or - (ansible_os_family == 'Suse' and ansible_distribution_major_version == '42') - msg: "The only supported platforms for this release are Ubuntu 16.04 LTS (Xenial), Ubuntu 18.04 LTS (Bionic), CentOS 7 (WIP) and openSUSE Leap 42.X (WIP)" + (ansible_os_family == 'Suse' and ansible_distribution_major_version in ['15', '42']) + msg: "The only supported platforms for this release are Ubuntu 16.04 LTS (Xenial), Ubuntu 18.04 LTS (Bionic), CentOS 7 (WIP) and openSUSE Leap 42.X and openSUSE Leap 15.X" - include: common-tasks/package-cache-proxy.yml when: install_method == "source" diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 4c9ca30914..2167d60ca5 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -86,11 +86,12 @@ case ${DISTRO_ID} in opensuse*) zypper -n install -l git-core curl autoconf gcc gcc-c++ \ netcat-openbsd python python-xml python-devel gcc \ - libffi-devel libopenssl-devel python-virtualenv - # Leap ships with python3.4 which is not supported by ansible and as + libffi-devel libopenssl-devel python-setuptools python-virtualenv + # Leap 42.3 ships with python3.4 which is not supported by ansible and as # such we are using python2 # See https://github.com/ansible/ansible/issues/24180 - PYTHON_EXEC_PATH="/usr/bin/python2" + source /etc/os-release + [[ ${VERSION} =~ 42 ]] && PYTHON_EXEC_PATH="/usr/bin/python2" ;; esac diff --git a/tests/roles/bootstrap-host/tasks/check-requirements.yml b/tests/roles/bootstrap-host/tasks/check-requirements.yml index 8bf577a09f..b67b254fa7 100644 --- a/tests/roles/bootstrap-host/tasks/check-requirements.yml +++ b/tests/roles/bootstrap-host/tasks/check-requirements.yml @@ -19,8 +19,8 @@ - (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'xenial') or (ansible_distribution == 'Ubuntu' and ansible_distribution_release == 'bionic') or (ansible_os_family == 'RedHat' and ansible_distribution_major_version == '7') or - (ansible_os_family == 'Suse' and ansible_distribution_major_version == '42') - msg: "The only supported platforms for this release are Ubuntu 16.04 LTS (Xenial), Ubuntu 18.04 LTS (Bionic), CentOS 7 (WIP) and openSUSE Leap 42.X (WIP)" + (ansible_os_family == 'Suse' and ansible_distribution_major_version in ['42', '15']) + msg: "The only supported platforms for this release are Ubuntu 16.04 LTS (Xenial), Ubuntu 18.04 LTS (Bionic), CentOS 7 (WIP), openSUSE Leap 42.X and openSUSE Leap 15.X" when: (check_operating_system | default(True))| bool tags: - check-operating-system diff --git a/tests/roles/bootstrap-host/tasks/prepare_hostname.yml b/tests/roles/bootstrap-host/tasks/prepare_hostname.yml index ef7e017b53..cb8ee5abd7 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_hostname.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_hostname.yml @@ -30,5 +30,15 @@ backup: yes - name: Ensure hostname is set - hostname: - name: aio1 + block: + - name: Set hostname using the Ansible module + hostname: + name: aio1 + # NOTE(hwoarang) The hostname module does not work on Leap 15 because of + # https://bugzilla.novell.com/show_bug.cgi?id=997614 + # As such we need to fallback to using the command directly. + rescue: + - name: Set hostname using hostnamectl + command: hostnamectl set-hostname aio1 + tags: + - skip_ansible_lint diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 1b32519dfa..a9ede7ab95 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -235,6 +235,11 @@ parent: openstack-ansible-deploy-aio nodeset: opensuse-423 +- job: + name: openstack-ansible-deploy-aio_lxc-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + - job: name: openstack-ansible-deploy-aio_distro_lxc-opensuse-423 parent: openstack-ansible-deploy-aio @@ -242,6 +247,13 @@ vars: install_method: distro +- job: + name: openstack-ansible-deploy-aio_distro_lxc-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + vars: + install_method: distro + - job: name: openstack-ansible-deploy-ceph-opensuse-423 parent: openstack-ansible-deploy-aio @@ -250,6 +262,14 @@ action: deploy scenario: ceph +- job: + name: openstack-ansible-deploy-ceph-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + vars: + action: deploy + scenario: ceph + - job: name: openstack-ansible-deploy-distro_ceph-opensuse-423 parent: openstack-ansible-deploy-aio @@ -259,6 +279,15 @@ scenario: ceph install_method: distro +- job: + name: openstack-ansible-deploy-distro_ceph-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + vars: + action: deploy + scenario: ceph + install_method: distro + - job: name: openstack-ansible-upgrade-aio_lxc-opensuse-423 parent: openstack-ansible-deploy-aio @@ -276,9 +305,24 @@ action: deploy scenario: aio_metal +- job: + name: openstack-ansible-deploy-aio_metal-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + vars: + action: deploy + scenario: aio_metal + - job: name: openstack-ansible-deploy-aio_nspawn-opensuse-423 parent: openstack-ansible-deploy-aio nodeset: opensuse-423 vars: scenario: aio_nspawn + +- job: + name: openstack-ansible-deploy-aio_nspawn-opensuse-150 + parent: openstack-ansible-deploy-aio + nodeset: opensuse-150 + vars: + scenario: aio_nspawn diff --git a/zuul.d/project-templates.yaml b/zuul.d/project-templates.yaml index 3400c3f416..354337152e 100644 --- a/zuul.d/project-templates.yaml +++ b/zuul.d/project-templates.yaml @@ -40,11 +40,13 @@ jobs: - openstack-ansible-deploy-aio_lxc-centos-7 - openstack-ansible-deploy-aio_lxc-opensuse-423 + - openstack-ansible-deploy-aio_lxc-opensuse-150 - openstack-ansible-deploy-aio_lxc-ubuntu-bionic gate: jobs: - openstack-ansible-deploy-aio_lxc-centos-7 - openstack-ansible-deploy-aio_lxc-opensuse-423 + - openstack-ansible-deploy-aio_lxc-opensuse-150 - openstack-ansible-deploy-aio_lxc-ubuntu-bionic periodic: jobs: @@ -59,6 +61,8 @@ voting: false - openstack-ansible-deploy-aio_distro_lxc-opensuse-423: voting: false + - openstack-ansible-deploy-aio_distro_lxc-opensuse-150: + voting: false - openstack-ansible-deploy-aio_distro_lxc-ubuntu-bionic: voting: false gate: @@ -70,11 +74,13 @@ jobs: - openstack-ansible-deploy-aio_metal-centos-7 - openstack-ansible-deploy-aio_metal-opensuse-423 + - openstack-ansible-deploy-aio_metal-opensuse-150 - openstack-ansible-deploy-aio_metal-ubuntu-bionic gate: jobs: - openstack-ansible-deploy-aio_metal-centos-7 - openstack-ansible-deploy-aio_metal-opensuse-423 + - openstack-ansible-deploy-aio_metal-opensuse-150 - openstack-ansible-deploy-aio_metal-ubuntu-bionic - project-template: @@ -85,6 +91,8 @@ voting: false - openstack-ansible-deploy-aio_nspawn-opensuse-423: voting: false + - openstack-ansible-deploy-aio_nspawn-opensuse-150: + voting: false - openstack-ansible-deploy-aio_nspawn-ubuntu-bionic: voting: false gate: @@ -105,5 +113,7 @@ jobs: - openstack-ansible-deploy-distro_ceph-opensuse-423: voting: false + - openstack-ansible-deploy-distro_ceph-opensuse-150: + voting: false gate: jobs: []