Commit Graph

31 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 8ae6540d0b Fix linters and metadata
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Change-Id: I74cefdfa885fa26dd7199fd0798527f511bf329d
2023-07-12 16:07:09 +02:00
Jonathan Rosser e31bee556c Use distro packages for nginx on centos.
There is no longer any need to get these from EPEL or the
nginx repos.

Change-Id: I24a031b5e14359f08a231dfc3429468561d48126
2022-05-29 17:33:00 +00:00
Jonathan Rosser 03b55edaae Remove all code for lsync, rsync and ssh
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/842571
Change-Id: I4f32c03179a1d8814548a92fc714a5fd9dd3f433
2022-05-19 16:33:18 +00:00
Jonathan Rosser dfe91c5ac0 Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: Ibe914d0d547b930b8167bfa475cc838df8d7ae25
2021-03-16 08:51:12 +00:00
Jonathan Rosser aab7090e4d Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I3e48000a4685d4df46cd60113ce4c0c02b63dc0c
2021-02-23 09:24:07 +00:00
Jonathan Rosser eea73c1011 Add Centos-8 support
This builds lsyncd from source files for CentOS 8 as there is no package
for it.

Change-Id: Iab8d28c32e534e62759dc2bc72bd6368fbea471d
2020-05-27 10:20:41 +00:00
Kourosh Vivan bd8a24716c Add possibility to overwrite nginx public repo
For Centos, we use by default public repo for nginx. You can change this
behaviour with these role-wide variables:
- repo_centos_nginx_mirror
- repo_centos_nginx_key

Or with these osa-wide variables:
- centos_nginx_mirror
- centos_nginx_key

Change-Id: I8dcb3c97e9593877a4a420bd32b50ae29d9d311c
2019-11-05 10:11:11 +01:00
Kourosh Vivan aecff065f1 Add Centos GPG key custom url
When using a custom repo with repo_centos_epel_mirror, you maybe need to
change the gpg key url because offline env

You can use this variable: repo_centos_epel_key

Change-Id: I9bb305d866f3d65653b95a25a5b9f5ecde5af0b0
2019-10-17 20:56:01 +02:00
Mohammed Naser ba7b358ccd [redhat] Install rsync-daemon for newer releases
The newer packages havee moved rsyncd into its own package called
rsync-daemon so we'll install that for anything newer than EL7.

Change-Id: Id1e8cc503d71cf6e7d0d84b5a74f6c3d7bce9393
2019-05-10 12:56:22 -04:00
Mohammed Naser 44547c7b7b pypiserver: drop pypi server
It is no longer needed because of how we are using python_venv_build
at the moment, so let's remove it.

Depends-On: https://review.openstack.org/648477
Change-Id: I56531388fb49a8c3d098fd762392299742b0e120
2019-03-29 10:02:36 +00:00
Jonathan Rosser 467f8e3080 Use distro packages only after they are installed
In an environment with sudo and lsyncd not already installed the pre
install tasks try to set up config files before the config directories
exist, and the tasks fail.

This patch moves the sudo and lsyncd config tasks to run after the
distro packages have been installed.

In addition, sudo is added as a required distro package for the
repo server.

Change-Id: Iab09b732d63d007c1d638ec9dc35834e564e5ce5
2018-10-25 12:08:26 +00:00
Jesse Pretorius 6663637374 Remove apt-cacher-ng
The repo container's package cache causes quite a bit of confusion
given that it's a 'hidden' feature which catches deployers off-guard
when they already have their own cache configured. This is really
the kind of service which people should manage outside of OSA. It
also makes no sense if the deployer is using their own local mirror
which is a fairly common practise. Adding to that, it seems that it
is broken in bionic, causing massive delays in package installs.
Finally, it also adds to quite a bit of complexity due to the fact
that it's in a container - so in the playbooks prior to the container's
existence we have to detect whether it's there and add/remove the config
accordingly.

Let's just remove it and let deployers managing their own caching
infrastructure if they want it.

Change-Id: I829b9cfa16fbd1f9f4d33b5943f1e46623e1b157
2018-10-08 14:48:32 +01:00
Jesse Pretorius 46ae829b33 Create virtualenv with '--never-download'
For upgrades, and some new build configurations, trying to
create a new venv results in the error:

Could not get output from /usr/bin/virtualenv --help: Traceback (most recent call last):
File "/usr/bin/virtualenv", line 6, in <module>
from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

To work around this issue, we do the initial build of the
venv using the CLI with the argument '--never-download'
so that virtualenv just uses the versions of pip, setuptools
and wheel that it already has.

Change-Id: I639bc78d34b640a52c32fa175b12fa958518e999
2018-08-09 08:54:24 +01:00
Jesse Pretorius 968ea1f223 Remove repo_requires_pip_packages and pip_install meta-dep
Given that the openstack_hosts role installs pip and virtualenv,
we do not need this extra meta-dependency and extra task/var.

Change-Id: Iac9f72586f6b26bd31d59a4fa5055687ff77f78b
2018-07-31 18:16:53 +00:00
zhulingjie 7c8e10977d Remove the unnecessary space
Change-Id: I4edb409131d122b2e426d115ee94c4a986bd3606
2018-07-11 23:02:53 -04:00
Jean-Philippe Evrard 6802793bb9 Fix usage of "|" for tests
With the more recent versions of ansible, we should now use
"is" instead of the "|" sign for the tests.

This should fix it.

Change-Id: Ib73373d8801c9eedd7c6e92b994a2fba0349ed90
2018-07-12 17:01:52 +02:00
Mohammed Naser 695503aa24 Add upstream NGINX and EPEL for selected packages only.
With the removal of EPEL, we are selectively adding packages that
we need.  This patch adds EPEL repositories only for lsyncd to
avoid conflicts and the NGINX upstream repositories for the web
server.

Change-Id: I832ae27570c5f35d01728a9e387fc451447b38ce
2018-06-16 23:27:55 -04:00
Jesse Pretorius 4e3213f4c6 Allow pypiserver to be upgraded before repo build
To cater for a situation where the pypiserver package is changing,
but the repo does not yet have the package built, we need to ensure
that the install task for it can fetch from pypi (or the designated
pypi mirror). To do this we try the local repo first, then fall back
to using the designated default index which defaults to pypi.

Change-Id: I1a2d36793fccc4c50f00247c8d19501ad8816517
2018-04-20 14:16:44 +01:00
Jesse Pretorius 610a4e6aa2 If virtualenv is broken, force re-install it
The virtualenv_support folder missing from the repo
container when upgrading due to the implementation
in the repo_build role which removes it. In order
to prevent breaking the virtualenv tooling, [1] is
being submitted. However, we still need to handle
the situation where the upgrade is done from a
version before that patch is implemented.

This patch implements a force-reinstallation of
virtualenv if the folder is missing.

[1] https://review.openstack.org/540351

Change-Id: I2dcfa1abb46ee4e088dac7c9e77e9772ba8a269e
Closes-Bug: #1746935
2018-02-02 13:09:50 +00:00
Jesse Pretorius 6320c00217 Implement pypiserver and pypi proxy cache
This patch implements nginx as a reverse proxy for python
packages. The initial query will be to a local deployment
of pypiserver in order to serve any locally built packages,
but if the package is not available locally it will retry
the query against pypi and cache the response.

Depends-On: Id20a43fed833d53ca0f147f517deafba6587352d
Change-Id: Ic4fd64f4dc82121a65088f3d7f4ae53f373df608
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-11-24 11:58:18 +00:00
Jenkins de8cef8ec8 Merge "Pass packages to install as a list" 2017-06-21 19:26:05 +00:00
Jimmy McCrory 81252bcc01 Pass packages to install as a list
Instead of using the slower loop, pass the
list directly to the package task to do
them all at once.

Change-Id: Icb55b5852629e73ee927291cc136d1a6a479be9b
2017-06-21 08:53:51 -07:00
Jesse Pretorius 9a11687bd0 Optimise apt cache update task
The update of the apt cache and the package installation
can all be handled in a single task by providing the
package action plugin with the right parameters. This
removes an extra task to optimise execution.

The minimum Ansible version is raised to 2.2 due to a
known bug [1] in Ansible's apt module which does not
update the cache properly if the cache update and the
install are combined in a single task.

[1] https://github.com/ansible/ansible-modules-core/issues/1497

Change-Id: I165479e62e921adb2a46fcbdb3b7c0118b2ef739
2017-04-25 22:54:58 +00:00
Jesse Pretorius (odyssey4me) 7ea0820e09 Revert "Install EPEL for repo_server role"
As EPEL is now deployed in the LXC cache and by the pip_install
role, this is no longer required.

This reverts commit 6106d6c4c9.

Change-Id: I2441f881059cd942345f4a01cbd82c643263010d
2017-03-10 16:02:39 +00:00
Marc Gariepy 6106d6c4c9 Install EPEL for repo_server role
The recent changes to remove EPEL and install RDO broke keystone
since some packages from EPEL are still required. This patch
ensures that the repo_server role can install packages from EPEL if
needed.

Change-Id: I85c46a522a4302542645451b9c8279a8e951fd25
Related-bug: 1670012
2017-03-07 13:42:48 -05:00
Donovan Francesco (drifterza) 9c8a51c8d0 Ensure we use the package module when installing packages.
Change-Id: Ia5f874eaf3d8ca08ca61a3ee1df3f8416fa83f6f
2017-01-30 13:59:17 +02:00
Jesse Pretorius 2d240b7ac6 Force Ansible to use dynamic includes
Ansible 2.1.1 introduces a regression in the way conditional
includes are handled which results in every task in the
included file being evaluated even if the condition for the
include is not met. This extends the run time significantly
for a deployment.

This patch forces all conditional includes to be dynamic.

Change-Id: I66de661bf9f68a2d91e3a2fec9c1eee826c17592
Related-Bug: https://github.com/ansible/ansible/issues/17687
2016-09-22 16:34:36 +01:00
Jimmy McCrory f59bafd778 Updated role for multi-distro support
Separate files have been created for vars and tasks related to a
specific package manager.

The 'repo_apt_packages' variable has been deprecated and renamed to
the more generalized 'repo_server_packages' to better describe its
purpose and to simplify reuse of existing install tasks between multiple
distros.

git daemon is configured to host git repositories from the repo servers
using the git protocol.

Currently, openstack-ansible uses git over http to access repositories
on servers created by this role.
fcgiwrap and its configuration within nginx should be removed in a
follow-up patch after openstack-ansible has been updated to use the git
protocol.

Change-Id: I62321a7b62dabca469eb072ddbf4e8f250ce0fb3
2016-05-13 10:48:57 +00:00
Kevin Carter 0c0b03b498
Removed pip requirements from the repo-server role
The pip requirements in this role are not needed to stand up the
repo-server. Being that they're not required they should be removed.
The needed bits used to build the python wheels will be re-added to
the repo-build role where it can leverage the cloned upstream upper
constraints file from the openstack global requirements repo.

Change-Id: I16cd9c3b00b4bcf886da1d31c69d19f49c46969f
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-02-25 13:26:42 -06:00
Jean-Philippe Evrard 88b3cc6340 Only update apt cache if necessary
Workarounding the upstream ansible apt module bug

documented here:

https://github.com/ansible/ansible-modules-core/pull/1517

For the next versions of ansible we'll be using, we should

check if the apt bug is fixed. When it's fixed, we could

abandon this change and use the standard apt module

with correct cache handling.

Change-Id: Iaff1eded0fd77ebfc69aca49b271ceaf719068a8
2016-02-15 14:49:43 +01:00
Kevin Carter 725222afee
first commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-09 09:25:37 -06:00