32 Commits

Author SHA1 Message Date
Mark Goddard
d5e5e885d1 During deploy, always sync DB
A common class of problems goes like this:

* kolla-ansible deploy
* Hit a problem, often in ansible/roles/*/tasks/bootstrap.yml
* Re-run kolla-ansible deploy
* Service fails to start

This happens because the DB is created during the first run, but for some
reason we fail before performing the DB sync. This means that on the second run
we don't include ansible/roles/*/tasks/bootstrap_service.yml because the DB
already exists, and therefore still don't perform the DB sync. However this
time, the command may complete without apparent error.

We should be less careful about when we perform the DB sync, and do it whenever
it is necessary. There is an argument for not doing the sync during a
'reconfigure' command, although we will not change that here.

This change only always performs the DB sync during 'deploy' and
'reconfigure' commands.

Change-Id: I82d30f3fcf325a3fdff3c59f19a1f88055b566cc
Closes-Bug: #1823766
Closes-Bug: #1797814
2019-07-12 08:56:54 +00: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
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
Alexandru Bogdan Pica
8e3b79440c Implement external MariaDB and pre-configured Databases support
This change allows the following use cases:

1. Using an already-configured MariaDB / MySQL server / Cluster
2. Using already-created DB users, without requiring root DB access.

Update: added external mariadb precheck

Change-Id: I78b0d178306d7c5293b0bf53e445f19f18b4b824
Implements: blueprint external-mariadb-support.
Closes-Bug: #1603121
2018-01-23 13:07:40 +00:00
caoyuan
36c530f9ed Fix the database user name for all roles
when create database user, it should use
database_user, not database_name.

Change-Id: I4dfa01d1a5a46c5c58f1fc47b0be71b186462764
Closes-Bug: #1698762
2017-06-20 21:19:31 +08:00
Jeffrey Zhang
7233b45d29 Refactor bootstrap.yml file
Change-Id: I00d2dcb0895548ba169ab85764cf546c2214cbf5
2017-01-12 23:37:50 +08:00
Jeffrey Zhang
1b0e701402 Simplify the Cinder LVM backend
Remove the unnecessary option in the  group_vars/all.yml file.

* removed some cinder.conf options like volume_backend_name,
  iscsi_helper, iscsi_protocol etc. these value can be configured by
  custom cinder.conf file, no need export as global variables.
* remove meaningless iscsi_ip_addess, which is not used in LVM driver
* force start iscsi relate when enable_cinder_backend_lvm is yes

TrivialFix
Change-Id: Ifcbfdad15e4d68bc5f20fc77e0315a09983ef022
2016-07-25 09:50:12 +08:00
Mathias Ewald
3894883871 External Ceph - Implementation Cinder
This patch adds support for external Ceph clusters for Cinder.

For clean integration the backend configuration mechanism had to be
slightly adjusted.

We now have the option to enable multiple backends for Cinder
independently.

Currently, the flags cinder_backend_iscsi and cinder_backend_ceph are
used to toggle backends.

Documentation on how to use external ceph was added.

Change-Id: I7e0267b90d62d6d881f24f063cdb894422ec8618
Partially-Implements: Blueprint: external-ceph
2016-07-19 12:45:48 +00:00
Waldemar Znoinski
a2c2eba34f add support for non-default database_port in kolla/ansible
This change makes each step of the kolla deployment aware
of the port database was configured to listen on.
It defaults mariadb_port to database_port.

Change-Id: I8e85d5732015afc0a5481cb33e0b629fdfa84a1b
Closes-Bug: #1576151
DocImpact
2016-05-13 12:12:25 +00:00
Serguei Bezverkhi
6c2d7c7944 Adds ansible code for iscsid and tgtd containers
This partially implements iscsi and lvm2 support for cinder
in Kolla. Adds ansible code for iscsid and tgtd containers.

Change-Id: I2a4cfcf104397396ea61a09637d9ef3fc77b515f
Partially-Implements: blueprint iscsi-lvm2-docker
2016-04-12 14:58:15 -04:00
Ryan Hallisey
1c3991c852 Upgrade cinder playbook
Cinder requires a specific order for an upgrade.
c-api -> c-scheduler -> c-volume -> c-backup as
referenced by this patch: https://review.openstack.org/#/c/269412/6

We may be dependant on that Cinder patch linked above.  Behavior without
this patch is unknown.

Change-Id: I3fd1fe62abb398935932dab6ce905a65f8aabbd0
Co-authored-by: Paul Bourke <paul.bourke@oracle.com>
Partially-implements: blueprint upgrade-kolla
implements: blueprint upgrade-cinder
2016-02-19 20:24:02 +00:00
SamYaple
80b7266ed1 Rename kolla_ansible to kolla_toolbox
This change is needed for clarity. We have a kolla-ansible script.
We have a kolla-mesos repo. We plan to have a kolla-ansible repo.
Already we have had far too much confusion about whether we are
talking about the container or the project. Naming this kolla-toolbox
eliminates all of that confusion and its probably a bit more accurate
of a name too.

Closes-Bug: #1541053
Change-Id: I8fd1f49d5a22b36ede5b10f46b9fe02ddda9007e
2016-02-02 18:12:15 +00:00
SamYaple
6d8959a962 Update all bootstraps to use Label
Add bootstrap label to all bootstrap containers to ensure that when
the a new container is launched a difference is seen between it and
the bootstrap container since we cannot rely on ENV variables for
this. This only affects mariadb at this stage, but it is needed to
ensure rabbitmq works when we switch to named volumes.

Change-Id: Ia022af26212d2e5445c06149848831037a508407
Closes-Bug: #1538136
2016-01-28 20:26:41 +00:00
SamYaple
34dac6a02c Convert cinder to kolla_docker
Change-Id: I2dd889941799f031b3f7be59cbdf4da93f5aa0d0
Partially-Implements: blueprint kolla-docker-module
2015-12-31 16:38:56 +00:00
Sam Yaple
970617b80a Make the database json variable more readable
Additionally remove tty from the container cleanup docker section. It
was added in a sed in a previous patchset by serves no purpose.

Change-Id: Ib617870616bca687f72ffaa44b2e9a3a11ef1011
Partially-Implements: blueprint cleanup-playbooks
2015-11-23 17:24:22 +00:00
Hui Kang
790bf336d5 Fix bootstrap for services
The bootstrap tasks could be started on any node listed in the
site.yml

The issue is that all the tasks must run on the same node, and the
only node that all the tasks can run on is the 'api' node due to
needing to start the bootstrap container which binds in the configs.

delegate_to is required to ensure that the proper node gets the task.

Co-Authored-By: Sam Yaple <sam@yaple.net>
Change-Id: Ica04ab366777a571a92212ac22c482f1881d4ecd
Closes-Bug: #1513598
Related-Bug: #1513439
2015-11-23 17:09:36 +00:00
Sam Yaple
4ad8db7168 Remove unused cinder-data container
The cinder-data container serves no purpose and is not actually used
past the bootstrap container and should be removed.

Additionally add the missing '---' header to the start.yml file.

TrivialFix
Related-Bug: #1513598
Related-Bug: #1513439
Change-Id: I22b630bbee954e12a4de5652b7fb068669f633c5
2015-11-09 10:47:16 +00:00
Sam Yaple
6b28343017 Incorrect parsed variable name
database_user_create was not correctly referenced when parsing the
variable names. This could never actually lead to a situation that
reported a false change, but it could break an operation if you were
using the --step option with ansible and skipped the database create
task.

TrivialFix
Backport: Liberty

Change-Id: Idf69fffcc3814f509448ccea11b7d175f074ccf1
2015-11-09 10:47:15 +00:00
Sam Yaple
e2bc9dcf79 bootstrap takes place on the wrong node
The bootstrap must occur on the nova-api node due to binding in the
nova-api directory (same goes for all other services)

Closes-Bug: #1513439
Backport: Liberty
Change-Id: Iab88b49712828085e4d7e7f85e6d8f0b7999a9bf
2015-11-05 16:30:44 +00:00
Sam Yaple
b2ac6e80cd Add tty to containers
sudo requires a tty to function by default on centos. Instead of
tweaking the sudo conf we can just add a tty. This has the added
advantage of making the containers more friendly if you have to
`docker exec -i <container> bash` into them.

Change-Id: If97a02ca1d37c243a787d98ade54bde8d641aecd
backport: liberty
Partially-Implements: blueprint functional-testing-gate
2015-10-14 10:54:33 +00:00
Sam Yaple
c5be228be8 Bump ansible to 1.9.2
Ansible 1.9.2 contains the fix needed for docker-py >1.2.0

This is needed for some gate reasons, but it is also a good version
bump because it fixes a few issues with delegate_to.

Change-Id: Iafbabb3b0232620849d0548c5cd9d8d316c2b0f3
backport: liberty
Partially-Implements: blueprint functional-testing-gate
2015-10-13 15:13:34 +00:00
Sam Yaple
94162bd08f Bring Kolla inline with FHS
This brings Kolla images inline with FHS and should make finding
locations of things more consistent and reliable with the linux world
at large.

Change-Id: Iece5b4da4bace0fb8b1f41a65ab2c852ec73e6f8
Closes-Bug: #1485742
2015-10-06 03:30:53 +00:00
Ryan Hallisey
57017b0acd Replace config-external with a JSON file for Cinder
Partially-Implements: blueprint replace-config-external

Change-Id: Ic247433290b51c9fb613d90e4a9a0f3d11526b35
2015-09-24 08:12:56 +00:00
Sam Yaple
f42528acaf Properly check failed status
No need for a new task.

Change-Id: I958f87ac9a1434a2f6052e0271f37e5f3109775e
Closes-Bug: #1492337
2015-09-06 11:21:44 +00:00
Vladislav Belogrudov
7f81dbc85b Check exit status of bootstrap containers
Currently bootstrap containers are waited to exit but are not
checked for exit status and ansible runs further tasks. If
bootstrapping fails we notice it at much later time.

Change-Id: I137fc11b0f9d1f03d2ded08a213e8dbd62741f92
Closes-Bug: #1492337
2015-09-04 19:47:54 +03:00
Paul Bourke
f5c996e77d Fix typo in task bootstrap task names
Not quite halloween yet...

Change-Id: Ib1973eea0b2dddc0e0845731d1212c4d4447cca5
Closes-Bug: #1490502
2015-08-31 11:27:10 +01:00
Vladislav Belogrudov
ad2b9019ae Cinder ansible waits for bootstrap container on all hosts
Bootstrap task runs bootstrap container on one host but
waits for its exit on all machines in inventory. This
gives error about non-existing container id.

Change-Id: Ie06c4da470c2e109d13b029fa674373b255653f3
Closes-Bug: #1487387
2015-08-21 12:34:27 +03:00
Steven Dake
98b98924ee Use database_user_create in the register operation
The register operation was registering user_database which is a global
variable in group_vars/all.yml.  This results in glance not being deployable
because user_database is overwrriten at keystone task registration time.

The result of this is the playbooks fail to deploy.

Change-Id: Ic69725fb09aa0a368ec5b0d8f47bfc768c29c70c
Closes-Bug: #1486876
2015-08-20 00:49:31 -07:00
Steven Dake
bd5e5bbb64 Use one data container for all data volumes
The previous method of using the API image for a data container
worked, but resulted in more data being bindmounted and copied
into the system.  This patch resolves that by essentially using
a distro-type as a FROM in a Dockerfile to generate
distro-type-data.  Further all of the data containers used
throughout ansible are modified to use this new data container.

Change-Id: I8846573d4f2d4b98d4f46c770bfefc6d4c5cd0b5
Partially-Implements: blueprint one-data-container
2015-08-18 20:52:27 -07:00
rthallisey
3c5165687a Cinder bootstrap container is not initializing the DB
When running cinder-ansible, the cinder db is never being initialized.
The bootstrap task needs to be fixed in order for cinder to run the db sync.

Change-Id: I01c5f5c34773ffc4e4f7fc7088a7277115db94dc
Closes-Bug: #1485745
2015-08-18 09:35:23 -04:00
Sam Yaple
a6f3a1073a Fix volumes_from for the ansible playbooks
Change-Id: Ib4b563d20d8e5ea5b81fb89e9ee4943487d7e6cd
Closes-Bug: #1485297
2015-08-16 09:10:58 +00:00
Swapnil Kulkarni
18f0e536f6 Add ansible support for Cinder
Change-Id: I0694e5ad95aa7f924ebd3a29dff1f85e6307b7ae
Partially-implements: blueprint ansible-cinder
Partially-Implements: blueprint remove-abstraction-ansible
Co-Authored-By: Ryan Hallisey <rhallise@redhat.com>
2015-08-12 03:41:48 +00:00