diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index b2854331..5c68bf63 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -57,8 +57,8 @@ parent: ara-api-database-backends nodeset: ara-database-server-multinode description: | - Deploys the ARA API server on Ubuntu 18.04 as well as Fedora 30 and - tests it against a central PostgreSQL server installed on CentOS 8. + Deploys the ARA API server on Ubuntu 18.04, Fedora 30 as well as CentOS 8 + and tests it against a central PostgreSQL server installed on CentOS 8. The job exercises the ara_api Ansible role, the ARA Ansible plugins, the ARA API clients as well as the API itself. run: tests/with_postgresql.yaml @@ -69,8 +69,8 @@ parent: ara-api-database-backends nodeset: ara-database-server-multinode description: | - Deploys the ARA API server on Ubuntu 18.04 as well as Fedora 30 and - tests it against a central MySQL server installed on CentOS 8. + Deploys the ARA API server on Ubuntu 18.04, Fedora 30 as well as CentOS 8 + and tests it against a central MySQL server installed on CentOS 8. The job exercises the ara_api Ansible role, the ARA Ansible plugins, the ARA API clients as well as the API itself. run: tests/with_mysql.yaml @@ -81,8 +81,8 @@ parent: ara-api-database-backends nodeset: ara-multinode description: | - Deploys the ARA API server on Ubuntu 18.04 as well as Fedora 30 and - tests it using the distributed sqlite database backend. + Deploys the ARA API server on Ubuntu 18.04, Fedora 30 as well as CentOS 8 + and tests it using the distributed sqlite database backend. run: tests/with_distributed_sqlite.yaml # TODO: The job should build a package from current source and test that package diff --git a/.zuul.d/nodesets.yaml b/.zuul.d/nodesets.yaml index 6ecad91b..c4d0d73c 100644 --- a/.zuul.d/nodesets.yaml +++ b/.zuul.d/nodesets.yaml @@ -9,6 +9,8 @@ label: ubuntu-bionic - name: fedora-30 label: fedora-30 + - name: centos-8 + label: centos-8 groups: - name: ara-database-server nodes: @@ -17,6 +19,7 @@ nodes: - ubuntu-bionic - fedora-30 + - centos-8 # Nodeset used to test instances of ARA API deployed on different operating # systems simultaneously. @@ -27,11 +30,14 @@ label: ubuntu-bionic - name: fedora-30 label: fedora-30 + - name: centos-8 + label: centos-8 groups: - name: ara-api-server nodes: - ubuntu-bionic - fedora-30 + - centos-8 - nodeset: name: ara-fedora-30 @@ -41,4 +47,4 @@ groups: - name: ara-api-server nodes: - - fedora-30 \ No newline at end of file + - fedora-30 diff --git a/roles/ara_api/README.rst b/roles/ara_api/README.rst index 9084077f..738251cf 100644 --- a/roles/ara_api/README.rst +++ b/roles/ara_api/README.rst @@ -7,7 +7,7 @@ This Ansible role provides a framework for installing one or many instances of `ARA Records Ansible `_ in a variety of opinionated deployment topologies. -It is currently tested and supported against Ubuntu 18.04 and Fedora 29. +It is currently tested and supported against Ubuntu 18.04, Fedora 30 and CentOS 8. Role Variables -------------- diff --git a/roles/ara_api/tasks/pre-requirements.yaml b/roles/ara_api/tasks/pre-requirements.yaml index 7d051b3d..0ac0f3a6 100644 --- a/roles/ara_api/tasks/pre-requirements.yaml +++ b/roles/ara_api/tasks/pre-requirements.yaml @@ -16,6 +16,18 @@ # You should have received a copy of the GNU General Public License # along with ARA Records Ansible. If not, see . +# EL8 doesn't install a python3 interpreter by default. +# System packages rely on /usr/libexec/platform-python and Ansible will use it +# but we want to use the non-system one. Install it if it's missing. +- name: Ensure python3 is installed for EL8 + package: + name: python3 + state: present + become: yes + when: + - ansible_distribution | lower in ["redhat", "centos"] + - ansible_distribution_major_version == "8" + # The ansible_python_version fact might end up retrieving the version of # python2 so we need to explicitely get the version of python 3 available. - name: Validate availability of Python 3.5 diff --git a/roles/ara_api/vars/CentOS.yaml b/roles/ara_api/vars/CentOS.yaml new file mode 100644 index 00000000..066f134c --- /dev/null +++ b/roles/ara_api/vars/CentOS.yaml @@ -0,0 +1,38 @@ +--- +# Copyright (c) 2019 Red Hat, Inc. +# +# This file is part of ARA Records Ansible. +# +# ARA Records Ansible 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 Records Ansible 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 Records Ansible. If not, see . + +# ARA has not been packaged for CentOS or RHEL yet +ara_distribution_packages: [] + +ara_api_required_packages: + - git + - python3 + - policycoreutils-python-utils + +ara_api_postgresql_packages: + - postgresql + - postgresql-devel + - python3-devel + - gcc + +ara_api_mysql_packages: + - mariadb + - mariadb-connector-c-devel + - redhat-rpm-config + - python3-devel + - gcc diff --git a/roles/ara_api/vars/RedHat.yaml b/roles/ara_api/vars/RedHat.yaml new file mode 120000 index 00000000..87d36d4c --- /dev/null +++ b/roles/ara_api/vars/RedHat.yaml @@ -0,0 +1 @@ +CentOS.yaml \ No newline at end of file diff --git a/roles/ara_frontend_nginx/vars/CentOS.yaml b/roles/ara_frontend_nginx/vars/CentOS.yaml new file mode 100644 index 00000000..164743e3 --- /dev/null +++ b/roles/ara_frontend_nginx/vars/CentOS.yaml @@ -0,0 +1,21 @@ +--- +# Copyright (c) 2019 Red Hat, Inc. +# +# This file is part of ARA Records Ansible. +# +# ARA Records Ansible 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 Records Ansible 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 Records Ansible. If not, see . + +ara_nginx_user: nginx +ara_nginx_group: nginx +ara_nginx_config_path: /etc/nginx/conf.d diff --git a/roles/ara_frontend_nginx/vars/RedHat.yaml b/roles/ara_frontend_nginx/vars/RedHat.yaml new file mode 120000 index 00000000..87d36d4c --- /dev/null +++ b/roles/ara_frontend_nginx/vars/RedHat.yaml @@ -0,0 +1 @@ +CentOS.yaml \ No newline at end of file