Commit Graph

41 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
Damian Dabrowski 2d0e465fd3 Add TLS support to repo_server backends
By overriding the variable `repo_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the repo_server backend.

The ansible-role-pki is used to generate the required TLS
certificates if this functionality is enabled.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/879085
Change-Id: I5c5d3dd5689ac122781303ad21dacc8a1fa746eb
2023-04-28 11:27: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 c966363bd4 Add facility to store repo contents on a remote mount
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/837706
Change-Id: I9008680a5f41287599d67f4ce70605b60bccabf3
2022-04-20 06:55:06 +00:00
Jonathan Rosser 8bdf307151 Use ssh_keypairs role to generate keys for repo sync
This uses ssh signed certificates so there is no longer the need
to distribute the repo_server public key from each repo_server to all
other repo_servers.

The legacy scripts and authorized key files are removed as a
migration step.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/836377
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/825292
Change-Id: I27770f3a781bdf62d2a37659e087b12db2fb459e
2022-04-04 17:09:53 +00:00
Zuul 8f105a7c72 Merge "Allow constraints files to be hosted on the repo server" 2021-03-17 09:41:48 +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 4400c9203f Allow constraints files to be hosted on the repo server
Change-Id: I2a28a180e0bb947da2b091ec0671a48ef857e8e5
2021-02-22 23:56:14 +00:00
Dmitriy Rabotyagov 1ac51ddea7 Bind services to mgmt network addresses
These addresses are given defaults of 0.0.0.0 in the role defaults
but in a deployment we know which address each service should bind to.

The variable repo_server_bind_address should hold the mgmt network IP
address for either containerised or metal deployments and drives the
bind addresses where necessary.

Co-Authored-By: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
Change-Id: Iff95282b91a94d22fc8f6cdbadefacb53cae5b79
2020-06-04 06:55:14 +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
Jonathan Rosser cf53ebacbd Remove apt-cacher-ng cleanup tasks
The apt-cache was removed a long time ago and these tasks should
already have been removed in the Train release. Remove them now.
There is no change for existing deployments as these tasks are no
longer required as the apt-cache component of the repo server is already
retired.

Change-Id: I42785ee153955eb6e72bef01c26791ae8eec2087
2020-05-02 18:48:59 +00:00
Dmitriy Rabotyagov 748d86411b Remove git deamon functionality
Caching git repositories has been deprecated in Queens, so it's high time
we removed this functionality.
This shouldn't influece OSA deployments in any way.

Change-Id: I35829aa35489f06dbb3b65f522f0a08318eccbfa
2020-05-02 16:53:16 +01:00
Erik Berg 860224c64e Exclude repo_build_global_links_path from sync
These files are only used by the repo_build during wheel requirements
and should only be needed and used on the repo_container they're on.

When you're transitioning from one distribution release to another,
e.g. xenial -> bionic, syncing the links directory between these
repo_containers can break the wheel building in weird ways.

Depends-on: I3bd6d3d987e32ee11c5f1fcb5c1b4b0fc797e7f9
Change-Id: Iaa2e52b26ba89802e06665ebe43fdf18e515abd7
2020-03-12 21:14:19 +01: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 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
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 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
Jesse Pretorius dab934bdb9 Remove the upstream pypi reverse proxy
Trying to reverse proxy upstream pypi has not turned out to
be very stable, or very useful. We've had many, many reports
of stability issues and the additional complexity for offline
and proxy usage is just not worth it.

Given we already have a mechanism in place to handle using
upstream pypi if the repo server is not there yet, disabling
this should just result in that mechanism kicking in and all
will be well again.

Once the repo is built, the reverse proxy to pypiserver will
then be exclusively used and the upstream pypi proxy is not
necessary anyway.

Depends-On: https://review.openstack.org/584393
Change-Id: Ie407c6a346de6b46c8f4d30caea8664a7f6bd341
2018-07-20 14:25:19 +00:00
Jesse Pretorius 3e247f6f57 Set the pypiserver root to the correct directory
The folder from which pypiserver will serve the wheels that are
pre-built in the repo-build process was incorrectly set, resulting
in pypiserver never, ever serving the wheels but instead always
forwarding on to the nginx reverse proxy to fetch things from
pypi.

Now that the root folder is correctly set, two things will happen:

* Wheels will be served from pypi, negating the need to use the
  pip_links, so [1] should pass once this merges.
* Once the repo build is complete, the packages available to
  install will be restricted properly to only the packages
  built by the repo build process.

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

Change-Id: I16706d399f6b026a6d0004fd07e5f18605a7b5db
2018-04-19 11:41:17 +01:00
Zuul a26fc175b6 Merge "Remove virtualenv-tools in the examples." 2018-01-15 17:09:36 +00:00
Jean-Philippe Evrard 92ef35d418 Remove virtualenv-tools in the examples.
We shouldn't use virtualenv-tools, and it shouldn't appear
in our documentation.

Change-Id: I168e400ab8176bc94e48822284441368d8e73441
Partial-Bug: #1741634
2018-01-15 14:25:41 +00:00
Kevin Carter f34c4cce6e Set pypi-server to cache and use known built wheels
The pypi server is able to use our existing built wheels. Because
the pypi-server recursivly scans the provided directory, all wheels
for from any source can be fed into the server making it a universal
solution for serving python packages; no matter the distro or 
archetecture.

To ensure system performance the pypi-server package has been changed to
include  the optional cache functionality it provides. As noted in the 
server docs,  enabling caching will greatly improve performance when 
serving thousands of packages.

> The documentation for pypi-server is all contained within the
  application, use `pypi-server -h`. That said, under bullet point 4,
  here - https://pypi.python.org/pypi/pypiserver#table-of-contents -
  an online copy exists.

Change-Id: Icc2ee264fc213b258642b5393dd78b1b26ef0542
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-12-11 19:15:12 +00:00
Jesse Pretorius a340308444 Allow the upstream pypi mirror to be changed
Currently the upstream pypi mirror is hard set to
pypi, but sometimes it is preferred to use a different
mirror. This allows the upstream mirror to be changed.

Change-Id: Icd93c0c801bfee1b4fdc8154d078067722c0640a
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2017-12-04 11:11:10 +00:00
Jean-Philippe Evrard 2b5f1f5cc0 Fix swift port conflict
To avoid any port conflict, whether on LB or on bare metal nodes,
we should make sure each service runs on its own port.

The 8080 port is already used by swift, and opendaylight.
We keep 8080 for swift, move opendaylight to 8180, and the
pypiserver to 8280 to avoid overlaps when everything runs on metal.

Closes-Bug: 1735764
Change-Id: I69dd043efe5d2e50e83014bdbd6a848bfcc2aa39
2017-12-02 17:10:37 +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
Jesse Pretorius 6eb316499f Remove unused variable and handlers
The variable repo_auto_rebuild appears to have been
introduced in kilo, but never used.

The 'Init reload' handler is no longer required as
all services are now managed via systemd and the
service module.

The 'reload ssh' handler is also unused.

Change-Id: I1078ff7d2bd1acd0d1cea90fb90bc632386f0daf
2017-11-21 07:33:57 +00:00
Antony Messerli 673480967e Ensure the /var/log/apt-cacher-ng directory created
It appears xenial doesn't create this directory by
default, so ensure it's created and set it ot the proper
user/group.

Can reference:
https://bugs.launchpad.net/ubuntu/+source/apt-cacher-ng/+bug/1512780

Change-Id: I84e466d7b0230de9e2dd79a9a0b61c2ff1ef40a1
2017-11-01 15:50:25 -05:00
Ravi Gummadi 33e7ad0400 Cap the number of worker threads
Users can configure the number of worker threads however when it's
not specified the calculated number of workers can get too large on
hosts with a large number of CPUs.

Change-Id: Idda6e476e9e9b5842c4cc03e9853ec31d123abc5
2017-02-23 05:45:07 -05:00
Kyle L. Henderson 1169edc47b Fix apt-cacher-ng file owners during rsync
The lsyncd service runs as the 'nginx' user such that files sync'd
from the master node to the backups will have 'nginx' as the owner.
However, the apt-cacher-ng service needs to be the owner to function
properly. This fix consolidates the pre and post sync tasks into
a script that can be called by lsyncd. The script can then change
the file owners as needed before and after the rsync.  The owners
need to be 'nginx' before the rsync so that lsyncd can update
files and 'apt-cacher-ng' after the sync so the cacher service works.

Additionally, setup lsyncd to sync each service's directory separately
rather than being rsync'd all together. This avoids lsyncd bouncing
services when their respective files are not being sync'd.

Change-Id: Ifaba17b89035398917f2b3257574e18eb9027c08
Closes-bug: #1649339
2016-12-19 18:48:53 -06:00
Jesse Pretorius 36351e9ce6 Add ability to change apt/yum package state
The current method of installing the distribution packages required is
set in the tasks and cannot be changed by a deployer.

Currently the apt task always installs the latest package. This results
in unexpected binary changes when a deployer may simply be trying to
execute a configuration change.

This patch adds the ability for a deployer to change the desired state
so that the results are predictable.

Change-Id: Iee1c61e431e93c60d9fa95e66a7fe278d0a11d3c
2016-08-02 15:43:34 +01:00
Kevin Carter 02e58dfda8 Implemented package caching on the repo server
This change implements package caching on the repo server.
To take advantage of this a deploy will need to do nothing more
than setup an apt-proxy configuration file. This will speed up
package delivery while also providing ha capabilities within the
environment.

Change-Id: I78b2fba6a1f294751bd7098513060015cb41300c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-07-22 10:17:54 +00: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
Jimmy McCrory b0836d3b22 Trim apt package list
Limit repo_apt_packages to a more minimally viable list of requirements
for deploying Nginx servers and syncing files between them.

Change-Id: I677c78473b7f0442f8c334cd59b8c676973f4535
Depends-On: I03d5c061ec506a9dc142ff55a50fb3ecb18c238f
Closes-Bug: #1550418
2016-03-16 07:40:44 +00:00
Jimmy McCrory eb72dbec3d Remove memcached_server dependency
The repo_server role does not require a memcached server and makes no use
of any related variables. Remove the memcached_server role dependency
and memcached variables.

Change-Id: I1c3b57ac3f25bac0e1640f5735cca7b73b573090
2016-03-07 08:24:36 -08: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
Jesse Pretorius f85882331a Remove yaprt/openstack-wheel-builder from repo-server
Both the yaprt package and the openstack-wheel-builder scripts are
no longer used for the repository building process.

This patch removes them.

Change-Id: I52073953e33948a9fdaeceea1127e46f7c820921
2016-01-20 10:15:46 +00:00
Matt Thompson cc7a3c2f8a Install libjpeg-dev
Review https://review.openstack.org/#/c/245966/ is currently failing
on building pillow, which requires libjpeg-dev.  This commit installs
libjpeg-dev in the repo server containers so that dependency can be
successfully built.

Change-Id: I50dd1e4941bc7f57ce0d43f637b5446df6c935ce
2016-01-18 11:56:53 +00:00
Kevin Carter 725222afee
first commit
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-12-09 09:25:37 -06:00