Commit Graph

77 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov e6683eac63 Deprecate os_congress role
Since congress service is no longer maintained since [1], we have no
reason to continue maintenance of the corresponding role

[1] https://review.opendev.org/721733

Depends-On: https://review.opendev.org/742515
Change-Id: I8337db363aa954e615b83f595e1c51987bc90368
2020-07-22 20:18:29 +00:00
Jonathan Rosser 2edaf9f06e Allow venv python interpreter to be overridden
Change-Id: I413821cbfd10686ddce8d64d156590de5dff2305
2019-09-11 17:49:30 +01:00
OpenStack Proposal Bot fd9e3760b9 Updated from OpenStack Ansible Tests
Change-Id: Ieb31b02144ce098c7d838ac7b15fc3022602c9df
2019-09-04 15:13:11 +00:00
Dmitriy Rabotyagov 9a22bc42e5 Replace include with import
During previous commit include_task was accidentally copy-pasted.

Change-Id: I2ac03af80fb57eeaf839ab72c91aaba0e2da3be0
2019-08-07 14:20:43 +03:00
Dmitriy Rabotyagov efce93beac service_setup: refactor service setup to a single file
This patch refactors the openstack user/service/endpoints creation to
service_setup.yml which will eventually be managed by
openstack-ansible-tests.

Change-Id: I355442124435db1891c65803051750a8d0a85c98
2019-08-01 17:33:30 +03:00
Dmitriy Rabotyagov 78bc984ade Convert dynamic includes to static imports
When task/role files are included using include_tasks, tags are not
passed to the included tasks. As a result, tags like neutron-config
do not have the intended effect. This patch changes include_tasks
to import_tasks for all cases where dynamic vars or loops are not used
so that tags are properly handled.

Reference -
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html
https://bugs.launchpad.net/openstack-ansible/+bug/1815043

Change-Id: Ifc210d2fc7f217105d83c0ad4f86a3939c6c93d3
2019-07-17 17:30:29 +03:00
OpenStack Proposal Bot 9ba9eae96d Updated from OpenStack Ansible Tests
Change-Id: I79225fcf83d07ef8e552200ee5a21e7ca88c9b66
2019-06-18 18:15:36 +00:00
OpenStack Proposal Bot 72e70066ec Updated from OpenStack Ansible Tests
Change-Id: Ic6a0ec10751790f6d269864f5c3ffeb411946176
2019-06-11 22:17:30 +00:00
Guilherme Steinmüller 7ae1717fee db_setup: refactor database setup to a common file
This patch refactors the database creation to db_setup.yml which
will eventually be managed by openstack-ansible-tests.

This also re-orders the mq_setup to be done earlier so these system
level dependencies are ready before service activation.

Change-Id: Iab25fcbd8f0f9a16a2f9fe3c400ab1cc843d01d0
2019-06-03 19:31:28 +00:00
OpenStack Proposal Bot 8c1c6e779b Updated from OpenStack Ansible Tests
Change-Id: Ic9b276a793eb9b37cae5cc89f8d4339a65210048
2019-05-09 11:34:24 +00:00
OpenStack Proposal Bot 05e31b2bfb Updated from OpenStack Ansible Tests
Change-Id: I6933adb34acee2116289859bae8fe7871090b6e5
2019-04-17 19:11:29 +00:00
OpenStack Proposal Bot 1b3b257832 Updated from OpenStack Ansible Tests
Change-Id: Idfa2f0c106017d2fb596292356c1926840fd2fe7
2019-04-17 07:25:16 +00:00
OpenStack Proposal Bot d2b937da03 Updated from OpenStack Ansible Tests
Change-Id: I2e57518d8d7c33e4736c013f57e154a1cdfaf060
2019-04-13 20:21:59 +00:00
OpenStack Proposal Bot 921be8097d Updated from OpenStack Ansible Tests
Change-Id: I21850124747b2f1d5fb940f103d1430ca89fdeac
2019-04-01 13:18:38 +00:00
Mohammed Naser fc3fac1e5c Update role for new source build process
The variables barbican_developer_mode and barbican_venv_download
no longer carry any meaning. This review changes glance to
do the equivalent of what developer_mode was all the time,
meaning that it always builds the venv and never requires
the repo server, but it will use a repo server when available.

As part of this, we move the source build out of its own file
because it's now a single task to include the venv build role.
This is just to make it easier to follow the code.

Change-Id: Iab0b3b551aedfbe45016d9e3b0f860a8f783cdce
2019-03-26 17:59:10 -04:00
Kevin Carter ae0620f4c6 Remove the private option from include_role
The private option on include role was never implemented and
will no longer be developed. This change removes the option
so ansible no longer raises a deprecation warning.

Change-Id: Id03e7e34f735f5c6129fcc1fb837a7b5c973bd84
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 00:49:47 +00:00
Jesse Pretorius 455c2b4433 Enable overriding the service setup host python interpreter
In order to enable the service setup host python interpreter to
be changed easily, we make it a variable. This will be useful
when someone sets the service setup host to be the utility
container, because we'll be able to set this var by default.

Change-Id: Id8c2dfe7f3f82e0945d1b4b0027911a692cf1e8b
2018-11-30 15:55:14 +00:00
Jesse Pretorius 504efcbf2b Use a common python build/install role
In order to radically simplify how we prepare the service
venvs, we use a common role to do the wheel builds and the
venv preparation. This makes the process far simpler to
understand, because the role does its own building and
installing. It also reduces the code maintenance burden,
because instead of duplicating the build processes in the
repo_build role and the service role - we only have it all
done in a single place.

We also change the role venv tag var to use the integrated
build's common venv tag so that we can remove the role's
venv tag in group_vars in the integrated build. This reduces
memory consumption and also reduces the duplication.

This is by no means the final stop in the simplification
process, but it is a step forward. The will be work to follow
which:

1. Replaces 'developer mode' with an equivalent mechanism
   that uses the common role and is simpler to understand.
   We will also simplify the provisioning of pip install
   arguments when doing this.
2. Simplifies the installation of optional pip packages.
   Right now it's more complicated than it needs to be due
   to us needing to keep the py_pkgs plugin working in the
   integrated build.

Depends-On: https://review.openstack.org/598957
Change-Id: I4cfe846f9abec47d992faf0c1335a8787c6ca0c4
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 11:59:07 +00:00
OpenStack Proposal Bot 299427ce9a Updated from OpenStack Ansible Tests
Change-Id: I47d42b4210990d28b7302f815b888eaef7e98fa4
2018-08-20 10:47:54 +00:00
Zuul f8667ca34d Merge "use include_tasks instead of include" 2018-08-17 04:06:53 +00:00
OpenStack Proposal Bot 9971cb8c19 Updated from OpenStack Ansible Tests
Change-Id: I2cb2372b630ccc7ba5dd3e8c3704f250da2195de
2018-08-15 13:40:32 +00:00
caoyuan 20f3ae971d use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

Switch to include_tasks or import_playbook as necessary

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Change-Id: Icbc1fab92895e1f70a2aedf9507491a1b789f205
2018-08-15 17:25:15 +08:00
Jesse Pretorius 3ed6c24eeb Allow tags to be used for MQ tasks
The use of 'include_tasks' and a loop of variables creates
a situation where a user is unable to use tags to scope the
inclusion of only the MQ tasks when running the playbooks.

The use-case this is important for is when the rabbitmq
containers are destroyed and rebuilt in order to resolve
an issue with them, and the user wishes to quickly recreate
all the vhosts/users.

Ansible's 'include_tasks' is a dynamic inclusion, and dynamic
inclusions are not included when using tags. The nice thing
about dynamic inclusions is that they completely skip all
tasks when the condition does not apply, cutting down deploy
time. However, given the use-case, we should rather take on
the extra deployment time.

This patch changes the dynamic inclusion to a static one,
adds a 'common-mq' tag to cover all MQ implementations,
and re-implements the 'common-rabbitmq' tag for the tasks
that relate to RabbitMQ specifically.

It also implements conditionals for each task set so that
the rpc/notify tasks can be skipped if a vhost/user is not
required for that purpose (eg: swift does not use RPC, and
most roles will not use notifications by default).

Depends-On: https://review.openstack.org/588191
Change-Id: If42433a564afd84a5f2d300d05fbdd6605ea4d3d
2018-08-07 12:57:53 +01:00
Zuul 76bb5307b7 Merge "Convert role to use a common systemd service role" 2018-08-01 02:42:53 +00:00
Kevin Carter feef273d71
Convert role to use a common systemd service role
This removes the systemd service templates and tasks from this role and
leverages a common systemd service role instead. This change removes a
lot of code duplication across all roles all without sacrificing features
or functionality. The intention of this change is to ensure uniformity and
reduce the maintenance burden on the community when sweeping changes are
needed.

The systemd journal would normally be populated with the standard out of
a service however with the use of uwsgi this is not actually happening
resulting in us only capturing the logs from the uwsgi process instead
of the service itself. This change implements journal logging in the
service config, which is part of OSLO logging.

OSLO logging docs found here: <https://docs.openstack.org/oslo.log/3.28.1/journal.html>

Change-Id: I83d31e3268e34d048aa6632c7999771d49f637a1
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-07-31 14:42:30 -05:00
Jesse Pretorius 341ad85ea0 Move MQ vhost/user creation into role
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement two new variables:
- congress_oslomsg_rpc_setup_host
- congress_oslomsg_notify_setup_host

These are used in the role to allow delegation of the MQ vhost/user
setup for each type to any host, but they default to using the first
member of the applicable oslomsg host group.

We also adjust some of the defaults to automatically inherit existing
vars set in group_vars form the integrated build so that we do not
need to do the wiring in the integrated build's group vars. We still
default them in the role too for independent role usage.

Finally, we remove the test mq setup tasks and clean up any unused
or unnecessary variables configured in tests.

Change-Id: I97770819e9421ed27575f3fe181b4420742b0820
2018-07-27 11:44:38 +00:00
Andy Smith 28b50f04e3 Update to use oslo.messaging service for RPC and Notify
This introduces oslo.messaging variables that define the RPC and
Notify transports for the OpenStack services. These parameters replace
the rabbitmq values and are used to generate the messaging
transport_url for the service.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Add transport_url generation to conf
* Add oslo.messaging to tests inventory and update tests
* Install extra packages for optional drivers

Change-Id: I96d43d5ff04254352980a2c0ba40ed7bb2e9f234
2018-07-26 09:40:24 +00:00
zhulingjie 11648896e7 Remove the unnecessary space
Change-Id: Iaa281b06ee7f2675ee62e7aaebdb4e2fe9737b0e
2018-07-11 23:17:23 -04:00
Jean-Philippe Evrard 28070c979c 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: I45c41bd5c88aa93df156670476a5667e6a1a1a12
2018-07-12 17:04:07 +02:00
Jesse Pretorius b335e3c672 Execute service setup against a delegated host using Ansible built-in modules
In order to reduce the packages required to pip install on to the hosts,
we allow the service setup to be delegated to a specific host, defaulting
to the deploy host. We also switch as many tasks as possible to using the
built-in Ansible modules which make use of the shade library.

The 'virtualenv' package is now installed appropriately by the openstack_hosts
role, so there's no need to install it any more. The 'httplib2' package is a
legacy Ansible requirement for the get_url/get_uri module which is no longer
needed. The keystone client library is not required any more now that we're
using the upstream modules. As there are no required packages left, the task
to install them is also removed.

With the dependent patches, the openstack_openrc role is now executed once
on the designated host, so it is no longer required as a meta-dependency for
the role.

Depends-On: https://review.openstack.org/579233
Depends-On: https://review.openstack.org/579959
Change-Id: Ie32143ba23b964f9ceda98f00ff9cfa1c7a131d6
2018-07-06 13:49:37 +00:00
Jesse Pretorius 2b4f3a4f0c Move database creation into role
There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement a new variable called 'congress_db_setup_host'
which is used in the role to allow delegation of the database setup
task to any host, but defaults to the first member of the galera_all
host group. We also document the variable 'congress_galera_address' which
has been used for a long time, but never documented. A bunch of unused
variables have also been removed.

Change-Id: Id22bb9c3c3146aee6ccd7462c4a52b0be718ad55
2018-06-28 14:35:27 +01:00
Zuul 2e1ef93a83 Merge "Only replace python when re-initializing the venv" 2018-04-23 15:04:08 +00:00
fpxie 9760a9add1 Do not log passwords
This prevents data to be leaked into the callback plugin.

Change-Id: I7393daf31dc83d9566839f5441265a569b42dcc3
2018-04-23 17:36:53 +08:00
Jesse Pretorius e24db20c91 Only replace python when re-initializing the venv
We reinitialize the venv to ensure that the right version of
python is in the venv, but we do not want virtualenv to also
replace pip, setuptools and wheel so we tell it not to. If we
don't do this then virtualenv will install the latest available
version, which is not what we want.

Change-Id: Ie26f236c0d1d433e0bb69da4fcb251a4e40a5615
Partial-Bug: #1764470
2018-04-18 10:29:37 +01:00
Jean-Philippe Evrard 39477ea148 Introduce os_congress role in gerrit
This commit makes possible to contribute to the os_congress role.
It ensures the roles follows the minimum testing, in order to
be improved later with further testing.

The minimum testing is a local API test that's currently not
passing and will be improved by the community.

Co-Authored-By: Taseer Ahmed <taseer94@gmail.com>
Co-Authored-By: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
Change-Id: Iffe98a040b93b1101fe3339edc84d6197e5a5da7
2018-02-14 10:17:23 +05:00
Taseer Ahmed 6f966b3322 remove trailing white space
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-25 13:30:43 +05:00
Taseer Ahmed 0750c6d1ee Handle tox linter errors
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-24 19:34:57 +05:00
Taseer Ahmed 7082dd4bc0 Mitigate for tox linters
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-23 15:59:44 +05:00
Taseer Ahmed e2b794a7d9 point congress_conf_dir to /etc/congress
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-13 12:57:38 +05:00
Taseer Ahmed 8b25b2d94d Correct file path for configuration files
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-09 18:42:39 +05:00
Taseer Ahmed 74403a1bd8 Add Vagrant file, tests and update Readme
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-09 14:58:01 +05:00
Taseer Ahmed 78c11f7a7d Add congress configuration templates
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-08 16:01:24 +05:00
Taseer Ahmed e0625bd8c8 generate configuration and copy files
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-07 12:48:24 +05:00
Taseer Ahmed c88c62db72 Add congress installation, db setup
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-06 21:18:26 +05:00
Taseer Ahmed 1aaf37c68b Redefine variables and endpoint
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-06 13:14:39 +05:00
Taseer Ahmed 3684deac78 resolve more syntax errors
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-05 14:21:56 +05:00
Taseer Ahmed 4be49dfe67 Correct syntax errors
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-05 12:09:11 +05:00
Taseer Ahmed 1079ce1f4a Add congress service setup
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-04 18:24:49 +05:00
Taseer Ahmed f6d72f8471 Change congress init to congress service setup
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-04 15:48:04 +05:00
Taseer Ahmed a7f1ddc560 Add 'when' to ensure congress setup
Signed-off-by: Taseer Ahmed <taseer94@gmail.com>
2017-10-03 22:40:30 +05:00