From 4bf2476a953bc757cd9eecd35cbacf06a6286e8c Mon Sep 17 00:00:00 2001 From: David Moreau Simard Date: Wed, 6 Feb 2019 17:13:45 -0500 Subject: [PATCH] Add python3-virtualenv to required packages on Fedora This wasn't caught in the integration tests because it is presumably included in the image we were using. Ansible will complain that it can't find a virtualenv binary if it isn't installed. Also work around the fact that the virtualenv packages are excluded in the dnf configuration. Change-Id: Id1bc861c99d04dad4d9c6b366b680e00e6891db7 --- .zuul.d/zuul.yaml | 1 + roles/ara_server/vars/Fedora.yaml | 1 + tests/role-integration-pre.yaml | 35 +++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 tests/role-integration-pre.yaml diff --git a/.zuul.d/zuul.yaml b/.zuul.d/zuul.yaml index d17ecf2..16122df 100644 --- a/.zuul.d/zuul.yaml +++ b/.zuul.d/zuul.yaml @@ -67,6 +67,7 @@ - test-requirements.txt required-projects: - openstack/ara-server + pre-run: tests/role-integration-pre.yaml run: playbooks/ara-server.yaml - job: diff --git a/roles/ara_server/vars/Fedora.yaml b/roles/ara_server/vars/Fedora.yaml index f6ac069..555882e 100644 --- a/roles/ara_server/vars/Fedora.yaml +++ b/roles/ara_server/vars/Fedora.yaml @@ -18,5 +18,6 @@ ara_server_required_packages: - git + - python3-virtualenv - libselinux-python - policycoreutils-python-utils diff --git a/tests/role-integration-pre.yaml b/tests/role-integration-pre.yaml new file mode 100644 index 0000000..e39daec --- /dev/null +++ b/tests/role-integration-pre.yaml @@ -0,0 +1,35 @@ +--- +# Copyright (c) 2018 Red Hat, Inc. +# +# This file is part of ARA Records Ansible. +# +# ARA is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# ARA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with ARA. If not, see . + +- name: Role integration pre-run + hosts: all + gather_facts: yes + tasks: + # The images built with diskimage-builder by the OpenStack infrastructure + # currently installs the virtualenv packages on Fedora and adds them to the + # exclude list in /etc/dnf/dnf.conf. + # Work around this since it prevents the role from working properly. + # When it attempts to install python3-virtualenv, it won't be found because of the exclude. + # Reference: https://github.com/openstack/diskimage-builder/blob/5b1844acf99d3797b1bbe02601e5ce94308cab55/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip#L134 + - name: Remove DNF excludes for Fedora + become: yes + lineinfile: + path: /etc/dnf/dnf.conf + regexp: "^exclude=" + state: absent + when: ansible_distribution == "Fedora"