Commit Graph

32 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 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 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
Marc Gariepy 64c683aa13 Fix order for removing nginx file.
the default config needs to be removed after the pkg is installed.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-openstack_hosts/+/766030
Change-Id: Ibb9ccd8b85f673103f3ce863a8eb0641ebb056fb
2020-12-10 07:44:42 -05:00
Georgina 7132acbd3b Allow remote detection of repo sync status
If a repo container and its data are deleted and recreated then it is
not currently possible for a loadbalancer healthcheck to differentiate
between an empty repo server and a correctly synchronised one.

This patch creates a file 'repo-sync-complete' as part of the process
of synchronising repo contents from master repo servers to slaves. The
presence of this file on the slave can then be used as the loadbalancer
healthcheck to ensure that repo contents are only served once sync has
completed.

In addition, this patch ensures that synchronisation occurs from the
master to a reprovisioned slave by triggering a master repo server lsyncd
restart handler during the initial setup of the slave repo server.
Currently, a freshly provisioned repo server will remain empty
for an indeterminate amount of time, this patch forces a complete re-sync
to occur.

Change-Id: I6913341674dbde5524c2270e824bda4544211eca
2020-10-27 13:37:21 +02:00
Jonathan Rosser 486b68e3ec Restart rsyncd if the configuration file is changed
Previously the handler for restarting rsyncd was never called.
Split the config file template task out from the nginx task and
notify the rsyncd handler when the config file is changed.

Change-Id: I47982b5974c686a6dec7bd1a789daa54ea9652c7
2020-06-04 07:59:46 +01:00
Jonathan Rosser 0eb03be4bb Pass strings to git_config module rather than have implicit conversion
This avoids the following warning:

[WARNING]: The value 0 (type int) in a string field was converted to u'0' (type
If this does not look like what you expect, quote the entire value to
ensure it does not change.

Change-Id: Ifaf4035b2101f6921182c3d3275554c7e5f4cfa2
2020-05-12 14:12:53 +01: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
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 a68a384a4f Enable git automatic thread count detection
The repo build process does many git clone operations. This patch
ensures that the repo server git configuration allows git to detect
and make use of the number of CPU which are present, which
benefits operations such as check out which are highly threaded.

Change-Id: Ib01fc1c560dcb9261c328841d7472c87434edab0
2018-11-22 14:00:43 +00:00
Kevin Carter 45bb9631b1
Add variable for the ssh service
The ssh service on ubuntu based systems is "ssh" which is established by
the service unit path `/lib/systemd/system/ssh.service`. When running
the service will respond to the name "sshd" however this is just an
alias. This change adds a variable to set the service unit name
based on the distro family which will allow the service to start should
it be masked.

Change-Id: I04b9f5ed761270c0bb76b607a6562b511c6f4773
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-09-30 10:00:05 -05:00
Jesse Pretorius 73941167f1 Ensure that SSHD is installed, enabled and running
The repo server relies on SSHD for the repo synchronisation,
so in this patch we ensure that it is installed, enabled and
running.

Change-Id: I0618e76125fc1489903b3518b9bef3999c8c7347
2018-09-14 14:40:15 -06: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 330459bc39 Move install tasks into pre_tasks
Several install-time tasks are in the post install
tasks, mixed in with the config tasks.

This patch moves them to the pre_install task set
to make a clean break between pre/install/post
tasks and tidies up the tasks a little.

Change-Id: I12bceda01e747bc1c41925a7d4afeca8f7ce9d8e
2017-11-21 08:08:31 +00:00
Chris Beukers 0420277703 Create venvs directory when repo server container is created
All the base directorys for the repo packages are placed
In the /var/www/repo directory
Most of the directorys that are placed here are created during
the task repo_post_install.yml however the venvs directory isnt
created till the repo build stage.

this can create a problem for the synchronisation of the
repository

The proposed change creates the directory during the repo server
creation instead of the repo_build process

Change-Id: If1dd5e568e06715f4321c391727d428e2e0805ea
2017-08-30 10:49:14 +02:00
Jesse Pretorius 891ba5de71 Split user create and ssh key generation
In order to allow an install and config split, but not
to have ssh keys left inside an pre-installed container,
the two tasks are split and tagged appropriately.

Change-Id: I33f4905363d102f65cda8769d1ff95bbce8f08f8
2017-06-15 20:05:31 +01:00
Markos Chandras 76ca77d16b Add SUSE support
Add support for SUSE based distributions. We also update the bindep.txt,
run_tests.sh, .gitignore, tests-repo-clone.sh and Vagrantfile files
from the openstack-ansible-tests repository.

Change-Id: I5a2b3cae0ed325abb3920e9a684d25898df6027d
2017-05-17 20:38:30 +01:00
Jean-Philippe Evrard c49a94dead Bring consistency to tags
Some tags were not applied on the highest level and forced duplication.
We apply here our practices to have role_name-(config|install) [1].

[1]: http://docs.openstack.org/developer/openstack-ansible/developer-docs/contribute.html#ansible-style-guide

Change-Id: Ib44b2aa978df1c763d8c619a37d1025c3a90e6c1
2017-01-13 14:24:43 +00:00
Jenkins aae3f2ba69 Merge "Fix apt-cacher-ng file owners during rsync" 2016-12-21 12:38:48 +00: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
Andy McCrae 997047b558 Remove Trusty Support from repo_server role
Change-Id: Ib5e24fcc7509a312ca8ee6c5811c3f194f16d662
Implements: blueprint trusty-removal
2016-12-15 15:32:32 +00:00
Logan V 68e8cc6854 Use ansible_service_mgr fact
This patch removes some extra tasks for detecting systemd and uses
the  fact instead.

Partial-Bug: #1640125
Change-Id: I213b38b166de724990958a316e577478d7e4823c
2016-11-10 07:22:32 +00:00
Kevin Carter f0804d328a
Remove file change on the openstackgit dir
The recursive file change on the OpenStackGit directory can cause
issues with git checkouts should any files contain extra bits within
the the git archive. This change simply removes the find + chmod
commands that were being used as they will likely break an upgrade,
both major and minor.

Change-Id: Ic67501edaaf01de63532fae6b655eff17aeb2556
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-16 17:11:00 -05:00
Kevin Carter 182da652ea Ensure the repo server has a valid log directory
This change is simply making sure that the repo server has a valid
log directory at "/var/log/nginx". In some cases, generally when
upgrading, this directory may not exists and because the package
is already installed the directory will not be recreated. This
change simply makes sure the log directory is created regardless.

Closes-Bug: #1623778
Change-Id: I823aff32417804d494c46b0d444a518e2601118d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-15 17:12:20 +00:00
Paulo Matias 0eba29b2e0 Fix error when the git folder contains broken symlinks
When the git repository folder contains symbolic links pointing to non
existant files, the task would fail because of ``follow: true``. We
do not really need to follow multiple levels of symlinks, therefore now
we only follow the base directory symlink if needed.

Change-Id: Id1eca14b0a96e5395d778a0666ece87bde8e6c92
2016-09-14 18:33:54 -03:00
Kevin Carter 7721ca82b1 Set permissions on the openstackgit directory
The change removes the constraint that would skip setting the directory
permissions in certain cases. Now permissions will be recursively set
and the task will follow symlinks should it encounter any at the provided
path.

This should solve permission related issues on playbook reruns and the
permissions will always be correctly set by the role.

Change-Id: I3d974d578f3e2323415e36c40efa48036b517468
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-14 03:19:27 +00:00
Jesse Pretorius f1705ace9f Fix git service folder create task
The attempt to resolve the issue of a pre-existing
link in the place of the directory
( https://review.openstack.org/367563 ) did not work
as the file module requires a source and dest when
implementing a link.

This patch separates the task and only executes the
directory create if there is no link in place.

As per https://github.com/willthames/ansible-lint/issues/161
the mode for all directories is set to include a leading
zero to ensure that it's enforced as octal.

Change-Id: I27a64e8edaee1f652a4b3a95d05941df34824660
2016-09-09 08:07:36 +00:00
Jesse Pretorius 53f6852ba3 Cater for git cache when preparing repo server
When a git cache is implemented, a symlink is already in place
for the git folder when the repo server is prepared. This causes
the directory setup task to fail because the folder already
exists as a link.

This patch detects the presence of the folder and adjusts the
directory creation task to know that it should be a symlink.

The task is re-organised a bit to make it easier to read.

Change-Id: Idca73d6ac4dc3c668b6991ab2aae4784d1fe059d
2016-09-08 20:45:32 +00:00
Jimmy McCrory c87a8c1d4c Remove fastcgi and related configuration
In I62321a7b62dabca469eb072ddbf4e8f250ce0fb3, git daemon was added to
support hosting git repos from the repo server over the git protocol.
When the integrated build transitions to using it, fastcgi and all
related configuration can be removed.

Depends-On: I09bc504490d4b5114895f7f646fc8254748a7f41
Change-Id: I7ec8277d3883d1f8891de6ae2b0881fe026a34c8
2016-07-26 16:15:49 -07: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
Jesse Pretorius fdda85f5a6 Remove unused python_packages and reports directories
The 'python_packages' and 'reports' directories are unused. This patch removes
them from the list of directories created.

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