Commit Graph

24 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov a184e4d224 Ensure service is restarted on unit file changes
At the moment we don't restart services if systemd unit file is changed.

We knowingly prevent systemd_service role handlers to execute
by providing `state: started` as otherwise service will be restarted twice.
With that now  we ensure that role handlers will also listen for systemd
unit changes.

Change-Id: Ibb1b0159ca8267ce3ab6ffb1752ab10ddb4b8139
2023-04-10 15:49:06 +02:00
Jonathan Rosser e00da435b4 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ifa117789eaa79b3107a4a3dd8d1e1379ca04d238
2021-03-16 08:00:40 +00:00
Jesse Pretorius 6e0502655a 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.
3. Deduplicates the distro package installs. Right now the
   role installs the distro packages twice - just before
   building the venv, and during the python_venv_build role
   execution.

Depends-On: https://review.openstack.org/598957
Change-Id: I1e722ad353564a6586e5b597d73b5e1dad6033d9
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 10:40:38 +00:00
zhulingjie c99344e6dd Remove the unnecessary space
Change-Id: I948191aa34de4b21e2e013e61f5be2047f39e77f
2018-07-11 23:17:41 -04:00
Jean-Philippe Evrard 7867f90e51 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: I25327d6d37ccedfa446f49acaea70de798ad8a01
2018-07-12 17:00:28 +02:00
Jimmy McCrory 2b250fc7ec Use listen instead of chained notifiers
From Ansible 2.2 onwards, listen can be used for
handlers instead of chaining notifiers. The
handlers are then executed in the sequence
present in the handler file.

Change-Id: I04d4c2bdb3a9152cef06995368a65931ba495ea0
2018-03-17 14:11:54 -07:00
Mohammed Naser 33f5dfa7e3 Drop MongoDB installation and API file configurations
Ceilometer no longer stores any data so the MongoDB installation
playbook is not used.  In addition, it no longer has an API so
the api-paste file is useless as well.

Closes-Bug: #1747612
Change-Id: I20104cc357f78b01e2b1246a3f51d609bb2f4f24
2018-02-06 15:28:48 -05:00
Jenkins 105d949ea6 Merge "Ensure that policy file has correct group/mode" 2017-05-24 23:51:20 +00:00
Jesse Pretorius ea1787f8a8 Use command instead of debug for handlers
Due to the debug message plugin the handler restart
messages show at the end of the playbook execution
which is a little confusing. Using debug also
requires setting changed_when to true which is a
little extra bit of code which we do not have to
carry.

Instead we use the command module which is simple,
works and less wordy.

Change-Id: Ide5abf639e90f8d81044aed59bd2c73b960be9e6
2017-05-24 11:31:27 +01:00
Jesse Pretorius 22bf0e24c5 Ensure that policy file has correct group/mode
When the policy file is copied from the templated
file to the active file, it loses its group/mode
settings. This patch ensures that they are properly
replicated during the copy.

Change-Id: I50c50958fbdcc7f3912189a0b47cda0cf9313927
2017-05-23 23:38:17 +01:00
Jesse Pretorius 0b86b75151 Perform an atomic policy file change
The policy.json file is currently read continually by the
services and is not only read on service start. We therefore
cannot template directly to the file read by the service
(if the service is already running) because the new policies
may not be valid until the service restarts. This is
particularly important during a major upgrade. We therefore
only put the policy file in place after the service restart.

This patch also tidies up the handlers and some of the install
tasks to simplify them and reduce the tasks/code a little.

Change-Id: I706d99cec90491216bb997ed06cbed6514e1b663
2017-04-28 16:52:55 +01:00
Miguel Alex Cantu 5e6ff1ea5f Remove Ceilometer API Service
Ceilometer API is now deprecated in favor of using
Gnocchi, Aodh, and Panko to pull telemetry information.

Change-Id: I4464fc6bd4ad3ef14e2638abcdb86180e82615e1
Closes-Bug: 1666640
2017-03-02 15:42:08 +00:00
Jean-Philippe Evrard ed0395a254 Use systemd module instead of shell
Using ansible systemd module to daemon reload and service reload
is the solution for the future. Let's embrace it!

Change-Id: I702a10266bec2e2b34f60abcd60159f34d2cacd3
Signed-off-by: Jean-Philippe Evrard <jean-philippe.evrard@rackspace.co.uk>
2017-01-19 13:33:58 +00:00
Marc Gariepy 4487698ad3 Add CentOS support for os_ceilometer role
Depends-On: Iaf51101bbaa5eba49f78e950152095913951430e
Change-Id: If002cf8f8f5c04df0dee664640ab725cea8c1a3b
2016-12-20 19:14:13 +00:00
Andy McCrae 17cd41e1cd Remove Trusty support from os_ceilometer role
As a part of removing Trusty from OpenStack-Ansible we shall aim to
remove this from all the roles.

Testing has already been removed for Trusty in the integrated build and
all individual repositories on master (Ocata), as such we can now go
ahead and remove the support within the roles.

Change-Id: Ia564599a02eeafecc5614271fe4afbb1eb812aea
Implements: blueprint trusty-removal
2016-12-12 11:49:16 +00:00
Jimmy McCrory a900930b7b Install ceilometer-polling on compute nodes
With the move to using a service-group mapping for installing services,
the ceilometer-polling agent now only installs on hosts within the
ceilometer_central_agent group when it should also be installed to the
ceilometer_compute_agent group. Adjust the service mapping to allow for
multiple group assignments per service and update relevant tasks to use
subelements to install each service within its assigned groups.

Also fix the 'Reload upstart init scripts' handler so that it can
properly be marked 'changed' in order to notify the 'Restart
ceilometer services' handler.

Closes-Bug: 1639026
Change-Id: Iba8e1f58c996a55389f50c727a4afa55099daa22
2016-11-03 17:45:45 -07:00
Logan V 726e419230 Fix linting issues for ansible-lint 3.4.1
Preparing this role for the ansible-lint version bump

Change-Id: Iae6a0600f2f48c1296e013641e9541773e86c27a
2016-11-02 02:44:17 +00:00
Jesse Pretorius 282de19074 Use dictionary for service group mappings
Change the 'ceilometer_service_names' from a list to a dictionary
mapping of services, groups that install those services. This brings
the method into line with that used in the os_neutron role in order
to implement a more standardised method.

The init tasks have been updated to run once and loop through this
mapping rather than being included multiple times and re-run against
each host. This may potentially reduce role run times.

Currently the reload of upstart/systemd scripts may not happen if
only one script changes as the task uses a loop with only one result
register. This patch implements handlers to reload upstart/systemd
scripts to ensure that this happens when any one of the scripts
change.

The handler to reload the services now only tries to restart the
service if the host is in the group for the service according to the
service group mapping. This allows us to ensure that handler
failures are no longer ignored and that no execution time is wasted
trying to restart services which do not exist on the host.

Finally:
- Common variables shared by each service's template files have
  been updated to use the service namespaced variables.
- Unused handlers have been removed.
- Unused variables have been removed.

Change-Id: I417f366e343a7b764e3bcd9ab75efc3a233b460b
2016-09-29 07:04:32 +01:00
Steve Lewis f2365ec17d Limit where Apache is installed for Ceilometer
Because Ceilometer is deployed with impacts on some deploy hosts,
Apache presents an undesirable surface area to deploying it seems to
be contraindicated.

Change-Id: I494875017509516e50af594c53430f5db90f5322
2016-09-14 20:49:44 -07:00
Steve Lewis 31cddcd762 Serve the ceilometer-api using mod_wsgi
With the dependent change merged Ceilometer API will no longer run
without a stand-alone wsgi engine. It is too late in the cycle right
now to bring over changes for nginx and/or uwsgi for this project so
only this deployment option is being supported at this time.

Change-Id: I3cff6b183feae3c346cd56602d7b733a6dd9a01b
Depends-On: I8812ea1a92d6dc7f41a490e971bb7a09dee9b304
2016-09-14 17:24:49 -07:00
Travis Truman acc08c1ecf Address Ansible bare variable usage
When executing the role with Ansible 2.1, the following
deprecation warning is issued in the output for some tasks.

[DEPRECATION WARNING]: Using bare variables is deprecated.

This patch addresses the tasks to fix the behaviour appropriately.

Change-Id: I21615fa7fea8332487cd83854d1f0cd243165e9d
2016-06-15 12:56:31 -04:00
Miguel Alex Cantu e6976a3ec1 Added ceilometer-polling upstart jobs
The ceilometer-central-agent and ceilometer-agent-compute
services are now completely removed from the liberty release
of ceilometer. The new implementation is to use ceilometer-polling
and call the respective pollsters by namespace.
This patch addes the neccessary upstart configurations for
ceilometer-polling and it also removes the deprecated admin_* options
from the ceilometer config file.
This patch set is also forcing ceilometer to use the Keystone
v2.0 API by adding the versioned path uder [service_credentials]
in the ceilometer config file.

Change-Id: Iba2bb148df4f3ae9d16b44c27ddff0c0d3fd29d3
UpgradeImpact
Closes-Bug: #1519423
Closes-Bug: #1519462
2015-11-29 22:47:17 +00:00
Miguel Alex Cantu 7511b91c41 Seperated out Telemetry Alarming (Aodh)
The alarming function of Telemetry has been seperated out
by design. This patchset creates new containers for these
alarming services and deploys them accordingly.

See:
http://lists.openstack.org/pipermail/openstack-dev/2015-September/073897.html

DocImpact
UpgradeImpact
Implements: blueprint liberty-release
Change-Id: I25294a25afa76d4d8bddad0a51c48485f33a6d20
2015-10-15 11:20:53 +01:00
Miguel Cantu b2251e12be Implement Ceilometer
This patch implements the implement-ceilometer blueprint.
It addes the necessary role/variables to deploy ceilometer
with a Mongodb backend. The Monogdb backend is assumed to
be up and configured and the playbooks only require a few
values to be set in user_variables to establish a connection.

Change-Id: I2164a1f27f632ce254cc2711ada2c449a9961fed
Implements: blueprint implement-ceilometer
2015-07-07 19:31:04 +00:00