Commit Graph

46 Commits

Author SHA1 Message Date
Guilherme Steinmüller 9e3bd3f320 Retire openstack-ansible-os_monasca
Change-Id: Ie8da46562c150885010b47980a1ee26bff4d3bc5
2019-06-11 20:22:23 +00:00
Dmitriy Rabotjagov 4d25ba8e6e Drop private argument for include/import role
Since ansible 2.8 dropped private argument is not supported anymore:
https://github.com/ansible/ansible/issues/45038

Change-Id: Ia2793f92359f386c92dde8b25cc380fcf7460633
2019-05-17 12:04:38 +03:00
Zuul b3dbcbd53b Merge "Add support for openSUSE" 2018-10-02 09:51:04 +00:00
kaiokassiano e7c468ed84 Add support for openSUSE
This patch aims to ensure that this role is functional in
opensuse distros.

Change-Id: I153ba0b5ba3b56f70d223f7e472e6213be146f27
2018-10-01 11:49:07 -03:00
Jesse Pretorius f9414ff0cb Delegate the database schema import to monasca_db_setup_host
In order to remove the requirement to install the MariaDB client
libraries on all monasca hosts, we need to isolate all DB actions
on monasca_db_setup_host which has those libraries.

Change-Id: I269a933a7e26a3f4564d18d6f05cfce4b4eafe27
2018-09-21 14:34:36 +01:00
Zuul 53469ef169 Merge "use include_tasks instead of include" 2018-09-08 21:23:22 +00:00
Jesse Pretorius 4f08a80f0a 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: I52ef39767ba8acc80ca0c9503c58efe7548ebba4
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 12:01:27 +00:00
ZhijunWei d70b99cfcb 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: I4bc3b952a87ff0351070f87746ee4b63e590aa2d
2018-08-22 11:43:22 -04:00
Jesse Pretorius 0218b5e5e1 Use monasca venv for influxdb setup
Instead of pip installing onto the host, we use the
influxdb in the monasca venv to do the influxdb database,
user, etc setup. This prevents interference between pip
installed packages and distribution packages, keeping the
line between host installed packages and venv installed
packages clean.

The venv is only deployed on the monasca_api servers, so
we change the group used for executing the tasks to the
right group for it to work.

Change-Id: I6e1f86a789f188dff611d522a3309a355f7cd8e8
2018-08-19 19:25:38 +00:00
Zuul 7eedc4f85d Merge "Fix monasca" 2018-07-18 04:29:09 +00:00
Jean-Philippe Evrard 0e4da819fd Fix monasca
This ensures the dependencies on the monasca roles are deployed
after the initial deploy steps of monasca. This allows us to
install on the host the packages required for the extra roles,
until they are fixed. Moreover, the grafana-ansible role is being
moved to ansible-grafana from cloudalchemy repository.

Change-Id: I9381c4994e38933fd12c02c673bfe409daf2a59c
Co-Authored-By: Guilherme Steinmüller <guilhermesp@lsd.ufcg.edu.br>
2018-07-17 17:47:46 -03:00
Jean-Philippe Evrard 402c012b9f 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: Iee01cc384368c76cf191244f4988ef735ee3d5d7
2018-07-13 09:29:19 +02:00
Jesse Pretorius 4b46ce34a7 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.

Change-Id: I673a465863559d6fc72e4fdcd5da2ab788e561ab
2018-07-12 18:03:14 +01:00
Jesse Pretorius 356317735b 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 'monasca_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 'monasca_galera_address' which
has been used for a long time, but never documented. A bunch of unused
variables have also been removed.

Change-Id: I42fe26054aec078a7a7ef66c20416af2cfb65811
2018-06-28 16:24:35 +01:00
Jesse Pretorius cac7008e57 Replace virtualenv-tools with a script
virtualenv-tools has a bug which gets triggered in gates: it can't
change the shebang of a virtualenv python bin/ files if they
were generated with a virtualenv script whose shebang ends with
python2 instead of python.

Because we can't modify virtualenv-tools, we use shell scripts
instead.

Change-Id: I62ae0b1f406f102fcb184913c5a6de54bb84c4c2
Partial-Bug: #1741634
Partial-Bug: #1764470
2018-04-24 13:52:24 +00:00
fpxie f6ee455f2b Do not log passwords
This prevents data to be leaked into the callback plugin.

Change-Id: I2c281e33c1bb6bf52198e35a78b77ea3ede1f2cf
2018-04-24 20:10:45 +08:00
Kaio Kassiano Moura Oliveira 800324d599 Revert "Use group_names to check a host belongs to group"
This reverts commit def3818792.

Those changes are causing troubles when running Zuul functional tests.

Change-Id: I13627b11c2a85b7a7dfc6c9950a36d08b162b9f5
2017-12-22 12:49:09 +00:00
Cuong Nguyen def3818792 Use group_names to check a host belongs to group
Change-Id: I203fa5a2bee7d3e8e817896d3bb74f946e4f128f
2017-12-01 10:06:48 +07:00
Flávio Ramalho 030df04ef8 Fix for monasca modules and other minor changes
This change fixes monasca modules to work with the latest version
of monascaclient.

Other minor changes:
  - Use cryptography instead of pycrypto
  - Removed duplicate variable for monasca_api_port
  - Added static paths for dashboards

Change-Id: Ib4fe27c276413bb2e1e5da3fe532d824745c5b99
2017-08-03 15:10:25 +02:00
Andy McCrae 049641f02d Allow the developer constraints to be adjusted
In order to do a developer mode that allows installation of packages
from local file, which take precedence over the developer_mode
constraints, we need to allow the order of the constraints to be
changed.

This patch adds a "pip_install_developer_constraints" var which is used
to set the developer mode constraints. By default this will leave the
same behaviour but will allow additional constraints to be added, or the
developermode constraints file to be overriden altogether.

Change-Id: I9fc7e0d9be83af274bb7cd02fff7010d58e908f1
2017-07-03 15:31:20 +01:00
Flávio Ramalho b884927071 Monasca role refactoring[+docs]
This patch refactors the whole monasca role by bringing consistency
with the other openstack-ansible roles. Main changes include:
  - Install services on its specific cointainer;
  - monasca-thresh, monasca-notification and monasca-persister was
    not being installed/configured, now it is;
  - Tempest tests are ran for the whole monasca-api;
  - The service should be fully functional;
  - Added documentation.

The extras directory contains the changes necessary to openstack-
ansible to setup monasca.

Change-Id: Ib53d4311c4b4aa722c7cdf7b18632e23b8639a56
2017-06-19 14:45:02 -03:00
Jenkins 4884c2453b Merge "Use package module to install distro packages" 2017-05-18 04:20:47 +00:00
Jesse Pretorius edd2093370 Use package module to install distro packages
Consolidate distro package install tasks into a
single task using the package module and pass
the package list into the name instead of using
a with_items loop.

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: I5d87e5e5d11bd1dcffb6a6187733f6d8e4e72fbf
2017-05-17 18:12:12 +00:00
Rick Box 72d2de8437 Fix for lookup and get_url occuring in different places
We use an SSH bastion host which we do our deployment through. The
deployment host doesn't have direct access to the same network as the
host. As a result the venv local checksum lookup fails.

I have described this here:

https://bugs.launchpad.net/openstack-ansible/+bug/1689283

This is a simple fix for this problem, assuming everything is good it
will need repeating in multiple places in the code base.

Change-Id: I240605a8cd76b6ee2dfebde8eb47d577c4f93c95
2017-05-17 18:12:05 +00:00
Kevin Carter 2746142b68 Ensure the components are isolated from the system
This creates a specific slice which all OpenStack services will operate
from. By creating an independent slice these components will be governed
away from the system slice allowing us to better optimise resource
consumption.

See the following for more information on slices:

* https://www.freedesktop.org/software/systemd/man/systemd.slice.html

See for following for more information on resource controls:

* https://www.freedesktop.org/software/systemd/man/systemd.resource-control.html

Tools like ``systemd-cgtop`` and ``systemd-cgls`` will now give us
insight into specific processes, process groups, and resouce consumption
in ways that we've not had access to before. To enable some of this reporting
the accounting options have been added to the [Service] section of the unit
file.

Change-Id: I619ab58574eedece7e00e323f91aeaec4c5b5a6e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-03-30 15:10:50 +00:00
Jenkins d0c59a4556 Merge "Clean up developer mode logic" 2017-01-16 14:17:52 +00:00
Logan V c2f3c075af Clean up developer mode logic
Fixes the ability to deploy a venv in cases where:
1) developer_mode is not enabled
2) A cached venv is not downloaded from the repo server

Additional cleanup to the developer_mode venv deployment
logic is implemented by adding a *_venv_download var
which is used to decouple developer_mode from the
cached venv extraction process so that a deployer
can force venv builds in-place (disable cached
venv usage) without enabling developer mode
constraints.

Change-Id: I0280dce05e9f20b035e64b85750c72895e83a4b7
2017-01-16 12:55:31 +00:00
Jean-Philippe Evrard 56f560f26a 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: Icaea5c3ed1a0bbdb664e136b36169fb328a54cff
2017-01-16 12:25:03 +00:00
Jenkins 18c5d9f1dc Merge "Adding required monasca roles so users can query the apis." 2016-11-16 13:12:34 +00:00
Donovan Francesco (drifterza) 7f1c7d8c52 Adding required monasca roles so users can query the apis.
Change-Id: Id225d81b2d24b0e952ca6fb95c77d72ba189fd69
2016-11-16 13:46:49 +02:00
Jesse Pretorius f5a066b36f Reinitialize venv upon install
Reinitializes (copies python, etc binaries) into the venv when
dropping a new venv into place. This is needed because the Python
binary packaged with the venv may not match the Python running on
the host it is being installed to. (ie. in the case of a Xenial
repo container and a Trusty target host.)

Change-Id: Ibedc836cbab89d82d59c90165cbe064775164742
Partial-Bug: #1637509
2016-11-16 09:14:26 +00:00
Jenkins 9ce2f1c49e Merge "Fix tmpfiles.d when multiple service are running." 2016-11-10 10:21:01 +00:00
Jenkins bfb45472f1 Merge "Use ansible_service_mgr fact" 2016-11-10 10:03:16 +00:00
Donovan Francesco (drifterza) d93457eaf7 Use ansible_service_mgr fact
This patch removes some extra tasks for detecting systemd and uses
the  fact instead.

Partial-Bug: #1640125
Change-Id: I630b9543d6f57292f523b39b9f862ecea9f87439
2016-11-10 08:15:53 +00:00
Donovan Francesco (drifterza) 5523577ffe Fix tmpfiles.d when multiple service are running.
- adding {{ monasca_lock_path }} for the monasca lock dir.

Change-Id: I4b6f1e72873b8e11ab805467d59cb45ba9a55af3
2016-11-10 08:39:41 +02:00
Jesse Pretorius afa2fba42b Remove join filter from pip module tasks
Ansible 2.2 now treats the 'name' argument for the pip module
as a list, removing the need for us to implement the join
filter to optimise the install execution.

Change-Id: If930f4ac68cb48148c0962338a5bd346ebea3dbc
2016-11-09 21:34:06 +00:00
Donovan Francesco (drifterza) 8ea0b5118d Simplify pip options/constraints mechanism
The current constraints generation for the
installation involves multiple tasks and multiple
variables.

Using multiple tasks extends the installation time
unnecessarily and the additional variables are
unnecessary.

This patch aims to simplify the mechanism and
hopes to speed it up a little.

Change-Id: I213c955f832fd7bd0bc3497d8d8005985ecb04bd
2016-11-09 16:22:42 +02:00
Donovan Francesco (drifterza) 57eefc0f84 Optimizing monasca role.
- Making role more compatible with keystone v3
 - Replacing variable names with more OSA aligned styling

Change-Id: I5b7230301faedfdfa63f12e51ccadcc16c26639a
2016-11-08 16:57:51 +02:00
Jesse Pretorius 86b05c62fe Use updated get_url module checksum functionality
Starting in Ansible 2.0, the get_url [1] module provides the
ability for a checksum to be provided to the get_url module
which will be verified against the local destination file
and the task skipped if it matches.

[1] http://docs.ansible.com/ansible/get_url_module.html

This patch implements the use of this functionality.

The ability to ignore a venv download failure is also removed
as this is not necessary or desirable. It is better for the
download to fail and the playbook execution to stop immediately
so that the failure point is exposed.

Change-Id: I26a6f2ade69d7e85340a37cdb373d7564f41b507
2016-11-07 17:57:50 +00:00
Donovan Francesco (drifterza) 57e026fccd Fix linting issues for ansible-lint 3.4.1
Preparing this role for the ansible-lint version bump

Change-Id: I8bfa56de4f69f121cdec419d3135153dc26edfbd
2016-11-07 18:45:22 +02:00
Donovan Francesco (drifterza) a67b4c9673 Better functional tests for monasca-api.
- This patch returns status code 200 if keystone auth token is
retrieved.
 - Minor adjustments to the keystone middleware sections.
 - Adjustments in user naming in service endpoint creations.

Change-Id: Ifbb356634b29f1586c44e1135a761bf1f6adddb0
2016-11-03 15:27:57 +02:00
Donovan Francesco (drifterza) 524a052417 Refactoring Monasca role to align more with OSA.
- This patch is to provide monasca backend services and monasca api,log-api
 - Adding the use of dictionary for service group mappings.
 - Switching to use tested external roles for backend services.

Change-Id: I7f6335f12a4b3a13acf6b644f16587ab1b46745f
2016-11-01 20:03:18 +02:00
Kevin Carter 396d4f1335 Ansible 2.1.1 role testing
Change-Id: Ia82a196be0b469900dfdcfb9cd3a4e1887ba082f
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-19 15:40:30 -04:00
Jesse Pretorius 5cad16706a Rename package lists (and related vars) appropriately
In order to make it easier to differentiate between the lists of
python packages, distribution packages, downloaded packages,
package pins and other similar variables the variable names are
being changed to ensure that they have a more explicit suffix
that defines the purpose and makes the naming more consistent.

This is to facilitate a lookup plugin which will be able to look
up all the package lists and present them as a consolidated piece
of data which may be used for artifact preparation.

Change-Id: Ibf9dda810f366b03c393ea6106c89e6ec49c5ee1
2016-08-30 19:04:17 +01:00
Travis Truman 641fab33a4 Role skeleton for os_monasca
So we can generate release notes, run tests, etc.

Change-Id: I3fcdd1ab92ac43393ab70117b228b7847f20da4a
2016-08-25 09:15:23 -04:00
Donovan Francesco cfda2f626d Initial Commit 2016-08-18 15:46:59 +02:00