48 Commits

Author SHA1 Message Date
Mark Goddard
de00bf491d Simplify handler conditionals
Currently, we have a lot of logic for checking if a handler should run,
depending on whether config files have changed and whether the
container configuration has changed. As rm_work pointed out during
the recent haproxy refactor, these conditionals are typically
unnecessary - we can rely on Ansible's handler notification system
to only trigger handlers when they need to run. This removes a lot
of error prone code.

This patch removes conditional handler logic for all services. It is
important to ensure that we no longer trigger handlers when unnecessary,
because without these checks in place it will trigger a restart of the
containers.

Implements: blueprint simplify-handlers

Change-Id: I4f1aa03e9a9faaf8aecd556dfeafdb834042e4cd
2019-06-27 15:57:19 +00:00
ZijianGuo
d7c4a4f2b9 Replace merge_configs with merge_yaml for merge mongodb.conf
Actually, 'mongodb.conf' is a yaml format configuration file. Do not use
merge_configs to merge it.

Change-Id: Id3c006df00c1e2d66472c2195781e01c640cab22
Signed-off-by: ZijianGuo <guozijn@gmail.com>
2019-06-21 22:40:25 +08:00
Xing Zhang
f7bfce20ad
Fix mongo command for supporting other port
If we change mongodb_port, the command for bootstraping mongodb
should not connect to the default mongodb port 27017.

Change-Id: I330999be577d6416df162ea33fa1f7a19df56029
2019-06-16 18:32:24 +08:00
ZijianGuo
08f5c50e74 Fix mongo command for checking replication status
By default, the mongo command connection address is '127.0.0.1:27017'.
If we change mongodb_port, It cause the handle 'Checking current
replication status' always connect to '127.0.0.1:27017'. So we need
add options like '--host' and '--port'.

Change-Id: I172ef3d19ff2bea97db3a5207c1a984cd188ceba
Signed-off-by: ZijianGuo <guozijn@gmail.com>
2019-06-10 10:58:51 +08:00
Mark Goddard
b123bf6621 Use become for all docker tasks
Many tasks that use Docker have become specified already, but
not all. This change ensures all tasks that use the following
modules have become:

* kolla_docker
* kolla_ceph_keyring
* kolla_toolbox
* kolla_container_facts

It also adds become for 'command' tasks that use docker CLI.

Change-Id: I4a5ebcedaccb9261dbc958ec67e8077d7980e496
2019-06-06 19:04:58 +01:00
Eduardo Gonzalez
1a682fab28 Support stop specific containers
With this change, an operator may be able to stop a
service container without stopping all services in a host.
This change is the starting point to start
fast-forward upgrades support.
In next changes new flags will be introducced to disable
stop dataplane services during upgrades.

Change-Id: Ifde7a39d7d8596ef0d7405ecf1ac1d49a459d9ef
Implements: blueprint support-stop-containers
2018-11-26 08:07:01 +00:00
Kien Nguyen
4dd4573759 Allow custom mongodb configurations
Change-Id: I114c582181e0c58fc5b3ce5b1735fb54a0fdd93e
2018-10-23 09:11:46 +07:00
Adam Harwell
f1c8136556 Refactor haproxy config (split by service) V2.0
Having all services in one giant haproxy file makes altering
configuration for a service both painful and dangerous. Each service
should be configured with a simple set of variables and rendered with a
single unified template.

Available are two new templates:

* haproxy_single_service_listen.cfg.j2: close to the original style, but
only one service per file
* haproxy_single_service_split.cfg.j2: using the newer haproxy syntax
for separated frontend and backend

For now the default will be the single listen block, for ease of
transition.

Change-Id: I6e237438fbc0aa3c89a3c8bd706a53b74e71904b
2018-09-26 03:30:38 -07:00
Zuul
3e45b2cbec Merge "Use include_tasks instead of include" 2018-07-27 08:16:08 +00:00
Lakshmi Prasanna Goutham Pratapa
14bf524756 Apply Resource Constraints to Services.
This commit is to apply resource-constraints to a few more OpenStack services.
Commit to  apply constraints to the last set of services will be made in
the upcoming commit.

Depends-on: Icafa54baca24d2de64238222a5677b9d8b90e2aa
Change-Id: I39004f54281f97d53dfa4b1dbcf248650ad6f186
2018-07-26 11:35:28 +00:00
Jeffrey Zhang
b51eeed89e Use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

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

Co-Authored-By: confi-surya <singh.surya64mnnit@gmail.com>
Change-Id: Ic9d71e1865d1c728890625aeddf424a5734c0a8a
2018-07-25 23:57:22 +08:00
Ha Manh Dong
30be04ea91 Specify 'become' for all tasks that use kolla_docker module
Add become to all tasks that use the module "kolla_docker"

Change-Id: I4309c4011687b88ec31d739fd8f834fe2326ff10
Partial-Implements: blueprint ansible-specific-task-become
2018-06-08 12:39:24 +00:00
Mark Goddard
2e190597bb Fix missed kolla_action and kolla_serial
In change I78cb60168aaa40bb6439198283546b7faf33917c, action was changed
to kolla_action, and serial to kolla_serial, to avoid Ansible warnings
due to use of reserved keywords. In that change, some keywords were
missed, and some changes that were merged since then have not switched
to the new variables. This change fixes all current instances of those
issues.

Change-Id: I357dffdfcb2b405e280a962d366ee65eebf0a8d1
Implements: blueprint migrate-to-ansible-2-2-0
2018-05-16 13:13:06 +01:00
Jeffrey Zhang
c567055176 Fix ansible warning
- rename action and serial to kolla_ansible and kolla_serial
- use become instead of "sudo <command>" in shell
- Remove quota for failed_when and changed_when in rabbitmq tasks

Change-Id: I78cb60168aaa40bb6439198283546b7faf33917c
Implements: blueprint migrate-to-ansible-2-2-0
2018-05-11 02:54:02 +00:00
Duong Ha-Quang
9965cc46ff Specify 'become' for only neccesary tasks (all other roles)
Add become to only neccesary tasks in roles:

- aodh
- barbican
- bifrost
- ceilometer
- ceph
- chrony
- cinder
- cloudkitty
- collectd
- congress
- designate
- elasticsearch
- etcd
- freezer
- gnocchi
- grafana
- influxdb
- ironic
- iscsi
- karbor
- kibana
- kuryr
- magnum
- manila
- mistral
- mongodb
- multipathd
- murano
- octavia
- panko
- qdrouterd
- rally
- sahara
- searchlight
- senlin
- skydive
- solum
- swift
- swift
- tacker
- telegraf
- tempest
- trove
- vmtp
- watcher
- zun

Change-Id: I6e32d94d4172dd96d09d8609e8a5221ab5586a31
Partial-Implements: blueprint ansible-specific-task-become
2018-03-12 09:37:43 +07:00
caoyuan
40b635b9c5 Optimize reconfiguration for mongodb
Change-Id: If3828170c00a9c5327b94d9253be93aefa147db9
Partially-implements: blueprint better-reconfigure
2018-01-30 13:34:11 +08:00
Bertrand Lallau
8e20a550af Fix warning during Mongodb bootstrap task
[WARNING]: when statements should not include jinja2 templating
delimiters such as {{ }} or {% %}. Found:
{{ (bootstrap_mongodb_cluster.stdout|from_json).ok != 1 }}

Reason: Ansible 2.3.0 does not like delimiters in when statement.

Fix small typo

Change-Id: I69ea5f640b8e841e532eca97b7ed3959e9335967
Closes-Bug: #1714337
2017-08-31 20:01:19 +00:00
Bertrand Lallau
991695a272 Simplify condition check on standalone services
Condition check are already performed here:
https://github.com/openstack/kolla-ansible/blob/master/ansible/site.yml
In order to simplify codebase, these checks can be removed for
standalone services.

Change-Id: Ib9842cd5363a1c7e56234a5e91dc264f89e2838f
2017-06-15 17:15:17 +02:00
James McCarthy
274291463e Change default permissions in jinja templates.
Many of the templates use 600, remove unnecessary permission
on these templates to bring them in line with the others.

Change-Id: I30fe1b3822b9c7bb6ab98729fc519dc1d603db27
2017-05-26 12:29:02 +01:00
Bertrand Lallau
afdd11b9a2 Generalize api_interface_address variable usage
Useful api_interface_address variable has been define here:
https://github.com/openstack/kolla-ansible/blob/master/ansible/group_vars/all.yml#L57
In order to simplify codebase we must use it as much as possible.

Change-Id: I18fec19bf69e05a22a4142a9cd1165eccd022455
2017-05-23 08:35:15 +00:00
Jeffrey Zhang
b1f015616c Add timeout parameter for precheck tasks
wait_for module waits 300 seconds for the port started or stopped.  This
is meaningless and useless in precheck. This patch change timeout to 1
seconds.

Change-Id: I9b251ec4ba17ce446655917e8ef5e152ef947298
Closes-Bug: #1688152
2017-05-04 09:02:25 +08:00
Jenkins
379424240b Merge "Fix mongodb cluster using wrong network interface" 2017-03-23 16:19:19 +00:00
Jenkins
9d0daa015a Merge "Enable sanity checks from kolla-ansible" 2017-03-09 17:31:51 +00:00
Paul Bourke
5418ada148 Enable sanity checks from kolla-ansible
Add a new subcommand 'check' to kolla-ansible, used to run the
smoke/sanity checks.

Add stub files to all services that don't currently have checks.

Change-Id: I9f661c5fc51fd5b9b266f23f6c524884613dee48
Partially-implements: blueprint sanity-check-container
2017-03-09 10:37:06 +00:00
Javier Castillo Alcíbar
44e8419a5f Fix dbPath typo in templates/mongodb.json.j2
During mongodb upgrade process "/var/lib/mongodb" should have
correct permissions, but a typo present in config.json was giving
permissions to "/var/lib/kolla/mongodb"

Change-Id: I916e7d831531131b2f141a2f7ac712d4a82f7e86
Closes-Bug: #1668303
2017-03-08 15:53:16 +01:00
Jeffrey Zhang
8fc8d327b3 Fix mongodb cluster using wrong network interface
MongoDB cluster only uses api_interface.

Change-Id: If24a1c9bd685b268068cb676a28316636af52b78
Closes-Bug: #1626339
2017-03-08 16:40:31 +08:00
caoyuan
a88fc50a62 Move mongodb precheck into its own role
Change-Id: I0c545d98eaf00642f82d575ceef8e0a2733090c2
Partially-implements: blueprint condition-pre-check
2017-01-16 21:31:18 +08:00
Vladislav Belogrudov
073cfb2a33 Some tasks fail if NIC names differ
During configuration file generation one uses local variable
api_interface that reference remote host. Instead we should
use hostvars to find out correct interface name for each host
mentioned in configuration.

Change-Id: I9f64fdf2cd18bcc0bbf1c4193349186d9a7658bc
Closes-Bug: #1650195
2016-12-15 13:58:30 +00:00
Jeffrey Zhang
fa45801946 Move precheck into its own role
* Merge prechecks.yml and site.yml playbook
* Create empty precheck.yml into all roles.

Change-Id: I8a138558a26c0a2a66c5fd48ed37be657c99c1dd
Implements: blueprint condition-pre-check
2016-11-03 14:48:58 +08:00
Jenkins
1c3ac012f6 Merge "Add upgrade tasks for Mongodb" 2016-10-19 13:02:51 +00:00
zhubingbing
d62cdeddde
Fix mongodb upgrade permission issue
Change-Id: I15966415854e370228b53344bfdfbcd417e18a53
Partial-Bug: #1631503
2016-10-17 17:41:05 +08:00
Jenkins
a683486a07 Merge "Remove unneeded blank lines" 2016-10-14 08:28:14 +00:00
Christian Berendt
ab51cdc15f Add upgrade tasks for Mongodb
Change-Id: I28849fc554e15c80adb7b507aa922c26a024c726
Closes-bug: #1631911
2016-10-10 12:56:49 +02:00
Mauricio Lima
18785f416c Remove unneeded blank lines
TrivialFix

Change-Id: I778d0a55adf1302c7a6f0702fec3a381d851f3df
2016-10-06 12:42:27 -03:00
Jeffrey Zhang
fa856556d5 Remove do_reconfigure.yml file for all roles
do_reconfigure.yml is introduced to use serial directive. But we use
it in wrong. Now serial has moved to playbook file. So it is time to
remove the do_reconfigure.yml file

Closes-Bug: #1628152
Change-Id: I8d42d27e6bc302a0e575b0353956eaef9b2ca9fd
2016-09-27 15:04:00 +00:00
Jenkins
1a3437af59 Merge "Copy mongodb_bootstrap_replication_set.js to /tmp on the deployment host" 2016-09-13 18:25:43 +00:00
Christian Berendt
e6d38854d6 Copy mongodb_bootstrap_replication_set.js to /tmp on the deployment host
Change-Id: I502801c0ce6b9ff6b8216d3fce9957061593674d
Closes-bug: #1622993
2016-09-13 13:28:35 +02:00
Mick Thompson
4c1482b999 Added serial option to site.yml.
Useful for upgrade etc., which is preferablly done serially.

Example usage: tools/kolla-ansible deploy OR tools/kolla-ansible upgrade

Closes-Bug: #1576708

DocImpact

Change-Id: I34b2e16f8ce53e472a4682a4738c4ac0f5abf00c
2016-09-13 09:26:51 +00:00
Jeffrey Zhang
066173bec0 Implement mongodb replication set cluster
Closes-Bug: #1605457
Change-Id: I1a8e746f79f4dfcc5a43e736c3461b316db3f593
2016-08-20 17:30:29 +00:00
Duong Ha-Quang
5e35fc54a6 Port with_ loop variable syntax to Ansbile 2 (finish)
Migrate to full variable syntax in with_ loop
instead of bare variables for:

- cinder
- haproxy
- ironic
- magnum
- mistral
- mongodb
- murano
- swift
- watcher

TrivialFix
Change-Id: I3ef2e79053cf609aaa710e43ffd0adbc5a97565b
2016-08-18 17:45:52 +07:00
Jenkins
1011b7cd24 Merge "map the host localtime to the container" 2016-05-03 19:12:15 +00:00
Jeffrey Zhang
0fcee87549 map the host localtime to the container
Closes-Bug: #1577148
Change-Id: I636cefc63cf532434a41af3898b63dffa711e280
2016-05-03 09:27:51 +08:00
Mauricio Lima
2c34214388 Remove unecessary blank lines
TrivialFix

Change-Id: I1f03d428c380dfdbde5ef33e7ea43cbf5e9154ce
2016-05-02 07:44:29 -04:00
Jeffrey Zhang
d9418c09dc Reconfigure mongodb service
Implements reconfiguring the mongodb service.

Closes-Bug: #1553523
Change-Id: I0e2beb43dfbb24772ad07668df8c0ee1c3cefb46
2016-03-07 16:05:38 +08:00
Hui Kang
ef24d9e597 Set mongodb log file to shared volume by heka
TrivialFix

Change-Id: I085ef2884749bb4ecc546b78052a5688e8b36ad3
2016-03-04 11:04:23 -05:00
Jeffrey Zhang
d26c259754 Add the default empty reconfigure.yml file to all roles
DocImpact

Partially-implements: bp kolla-reconfig
Change-Id: I9738e80960bcfbef18d1ef1b7942f81c45684e85
2016-02-25 09:32:53 +08:00
Paul Bourke
be0aa14d86 Add missing upgrade stubs for kibana/mongodb
TrivialFix
Co-Authored-By: Ryan Hallisey <rhallise@redhat.com>

Change-Id: Ia83f642d3817116e2ba99285efc12b583f07bbd1
2016-02-09 17:26:14 -05:00
Hui Kang
3ae0063944 Add an ansible role for mongodb
Change-Id: Ia6ac371845d1f2b545406d096b35a6d5f68be5f6
Implements: blueprint ansible-mongodb
2016-01-27 10:48:34 -05:00