135 Commits

Author SHA1 Message Date
Alexandru Bogdan Pica
9822bb535e Fix MySQL access denied error during upgrade
This change makes it so that if preconfigured database users are used,
the attempt to change the log_bin_trust_function_creators mysql
variable isn't made anymore.

Also updated the upgrade docs

Change-Id: I356313952d435de6d3b5444c0dd8a71f45aee452
Closes-Bug: 1748269
2018-02-09 14:18:05 +02:00
Dai Dang Van
d77930373e Support policy.yaml file [part 2]
- Keystone
- Glance
- Nova
- Cinder

This will copy only yaml or json policy file if they exist.

Change-Id: I4a9415d82322aed68c9b7650bdf346f58fa49e2a
Implements: blueprint support-custom-policy-yaml
Co-authored-By: Duong Ha-Quang <duonghq@vn.fujitsu.com>
2018-01-29 13:35:59 +00: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
Michal Rostecki
307d324f36 dev mode: Add support for keystone
Provide support fot kolla dev mode in Keystone. When
'kolla_dev_mode' or 'keystone_dev_mode' variables are
enabled, source code of Keystone project is cloned
and bindmounted.

Partially implements: blueprint mount-sources

Change-Id: Ie4cf401ecd9a507e739a53dfdf16f65292ab57e5
2018-01-09 07:54:19 +00:00
Duong Ha-Quang
f7870e1d2f Implement Keystone zero-downtime upgrade
1- Expand and migrate database in first keystone node
  2- Upgrade all nodes sequentially along with updation of each node's
     configuration file with latest release version
  3- Last keystone node, contract database

With this patch, there is small downtime when all containers are
restarted. It will be fixed in other patch.

[1] http://docs.openstack.org/developer/keystone/upgrading.html#upgrading-without-downtime

Co-Authored-By: Surya Prakash Singh <surya.singh@nectechnologies.in>
Co-Authored-By: Eduardo Gonzalez <dabarren@gmail.com>
Co-Authored-By: Duong Ha-Quang <duonghq@vn.fujitsu.com>

Partially-Implements: blueprint ks-rolling-upgrade-role

Change-Id: I2159af567c40848840ff5e483e7d1f6de760b435
2017-11-16 11:13:50 +07:00
Eduardo Gonzalez
953861bde1 Clean update endpoints task in keystone upgrade
Endpoints are updated in pike upgrade,  queens and later
dont need such action.

Change-Id: I13723bafc4bf09c24d9bcd2ec7b4e002ae83aec0
2017-11-12 22:38:45 +00:00
Duong Ha-Quang
2d3866c6a4 Specify 'become' for only necessary tasks (default roles)
Add become to only neccesary tasks in roles:
- glance
- heat
- horizon
- keystone
- neutron
- nova
- openvswitch

Gate is also updated to use 'become' feature

Change-Id: I2f3f27306e9f384148e1ad4d54d8da2ebef34d00
Partial-Implements: blueprint ansible-specific-task-become
2017-10-31 02:55:31 +00:00
Eduardo Gonzalez
56374206be Fix deployment with public TLS enabled
When deploying with tls enabled in public
endpoints, ansible modules fails due SSL certificates
are self-signed.

This change adds a new variable to allow customization
on which endpoints ansible should connect.
Defaults to admin because admin auth parameters defaults
to admin endpoint.

Change-Id: Ic3ed58cf9c9579cae08a11bbfe6fce983b5a9cbc
Closes-Bug: #1720995
2017-10-05 08:36:34 +00:00
Bertrand Lallau
a3dfdfc085 Simplify Openstack services configuration possibilities
Actually Openstack services configuration can be overriden using many
files:
- /etc/kolla/config/<< service name >>/<< config file >>
- /etc/kolla/config/<< service name >>/<<host>>/<< config file >>
- /etc/kolla/config/global.conf
- /etc/kolla/config/database.conf
- /etc/kolla/config/messaging.conf

Only per-service configuration is actually documented here:
https://github.com/openstack/kolla-ansible/blob/master/doc/advanced-configuration.rst#L164

Allowing to globally modify service configuration can be perform too,
but it can be done in 3 different manners, all not documented:
- /etc/kolla/config/global.conf
- /etc/kolla/config/database.conf
- /etc/kolla/config/messaging.conf

database.conf and messaging.conf seems redundant with global.conf.
In order to simplify codebase it seems logical to remove them.

Documentation has been added for overriding configuration globally and
release note has been added too.

Closes-Bug: #1682479
Change-Id: I5d922dfc0d938173bad34ac64e490b78db1b7e31
2017-09-13 17:47:36 +02:00
Eduardo Gonzalez
ca82b29858 Wait keystone_fernet running before init tokens
Init fernet task fails if keystone_fernet container
is not running and ssh port bind.
This change add a check to ensure all keystone_fernet containers
are running before init fernet tokens.

Change-Id: Ib95bb5a47a9174f1a00b82cc8b697c0dc19c848e
Closes-Bug: #1704758
2017-07-26 10:52:59 +00:00
Jenkins
aa64cd384e Merge "delete delimiter from init fernet condition check" 2017-07-17 08:18:16 +00:00
Jenkins
c88b9eb40e Merge "Clean some Boolean condition checks" 2017-07-13 08:48:44 +00:00
Jenkins
a71aa61ea7 Merge "Use unified vars in task" 2017-07-12 01:56:12 +00:00
Bertrand Lallau
8b5b3cef4e Clean some Boolean condition checks
* "bool" filter is removed when not required
* 'not' is used instead of '== False' check

Change-Id: I85a5bb9a5ea874ac1c397cbf8de416147d2424c3
2017-07-10 15:00:28 +00:00
Noboru Iwamatsu
2182e5631e delete delimiter from init fernet condition check
In ansible 2.3.1, conditional statement should not include jinja2
templating delimiters (e.g. {{ ).  So, this change removes the
delimiters from when statemant, and also removes unnesessary
parentheses from until statement.

Closes-Bug: 1702607

Change-Id: I071ffd5ba6175ee1bc61719a84b805c022753459
2017-07-10 13:51:00 +00:00
Jenkins
0572a394be Merge "Avoid launching "local" actions too many times" 2017-07-10 13:40:49 +00:00
Bertrand Lallau
2e70a4d136 Fix keystone-paste.ini custom file management
Custom file was check on remote target instead of local.

Change-Id: I9426056e7bb284eb8b3ad539d61ecb1e1f6370e4
Closes-Bug: #1702490
2017-07-05 14:31:30 +00:00
Bertrand Lallau
a9113fc466 Avoid launching "local" actions too many times
In order to speed up deployment time some "local" actions should be run
only once using 'run_once: True'.
This will decrease deployment time in case of multihost configuration.

Change-Id: I6015d772d35c15e96c52f577013b6e41197cb41a
2017-07-05 15:55:39 +02:00
Jenkins
19c1bc7f88 Merge "Remove symlink in reconfigure tasks" 2017-07-04 03:11:37 +00:00
Eduardo Gonzalez
8d5526c070 Remove symlink in reconfigure tasks
Some roles have a symlink to deploy.yml file
for reconfigure. This is causing some issues.
"included task files must contain a list of tasks"

Change-Id: Ie7ade52900a61bc1c5b867fa7a8f75fc541a6426
Closes-Bug: #1694251
2017-07-03 09:34:21 +00:00
Jenkins
f2f3104e9f Merge "Fix the database user name for all roles" 2017-07-01 00:41:49 +00:00
Jenkins
3b86d5fda2 Merge "Remove the unnecessary jinja2 templating delimiters" 2017-06-28 14:43:25 +00:00
Jenkins
9e88df11ab Merge "Retry Keystone's default user role creation" 2017-06-26 14:57:06 +00:00
jiangpch
77358dd920 The notify "Restart keystone containers" is not correct
No handler named "Restart keystone containers", and we should restart
the keystone and the keystone-fernet container according to the context

Closes-Bug: #1699924

Change-Id: I62512dc022426cc762ff603d8554e48651fa621f
2017-06-23 00:51:10 +00:00
Juan J. Martinez
ba5c430278 Retry Keystone's default user role creation
Sometimes Ansible is faster running tasks that haproxy tagging Keystone
services as UP. Keystone bootstrap uses SQL directly but the default
user role creation requires the API, and because of that it may fail.

Retry in case the backend is not yet available.

Change-Id: I9dfc030bbf92ca0a3dcb008d55e9fa2055f900ec
Closes-Bug: 1699096
2017-06-20 15:24:18 +01: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
Jenkins
bdb3a12db4 Merge "Use templates for keystone domain specific configurations" 2017-06-19 08:50: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
Jeffrey Zhang
03e1b05f99 Use unified vars in task
Ansible task support vars directive, no need implement another one in
merge_config. This patch remove the vars directive in merge_config
action plugin.

Change-Id: I33648a2b6e39b4d49ce76eb66fbf2522721f8c68
2017-06-15 22:37:28 +08:00
Jenkins
c59714ccff Merge "Remove keystone-paste.ini file in kolla" 2017-06-13 14:58:04 +00:00
Jeffrey Zhang
6ce222af3e Remove keystone-paste.ini file in kolla
keystone-paste.ini file is introduced by
I3a3ca2e74c0ae341105d3481f97956c6da473046 for a security risk of
admin_token_auth middleware. Now this middleware is removed by
I57586ccfa0ad1309cc806d95377dc1ecad015914. So it is safe to use upstream
keystone-paste.ini file.

This patch also keep custom paste file feature. Just put the file to
/etc/kolla/config/keystone/keyston-paste.ini path.

Closes-Bug: #1695023
Partially-Implements: blueprint custom-paste
Change-Id: Ieb983b6a9edb6a156928f6b56a4bd2dbed4281e2
2017-06-13 01:38:29 +00:00
Christian Berendt
20df814528 Use templates for keystone domain specific configurations
Change-Id: Idb40cbed763382bef9965c6b090e71156b671590
2017-06-12 16:42:02 +02:00
caoyuan
597e112a2c Remove the unnecessary jinja2 templating delimiters
[WARNING]: when statements should not include jinja2 templating
delimiters such as {{ }} or {% %}. Found: {{
(keystone_bootstrap.stdout | from_json).changed }}

Closes-Bug: #1689550

Change-Id: Ib6fdbcde02319011b072990f06fbd5e74b8d2d93
2017-06-04 15:00:44 +00: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
Paul Bourke
8006ecdacf Update keystone sanity check to use built in shade
The current module 'kolla_sanity' was written as a shim before full
shade support was added to Ansible. This should now no longer be needed,
we can implement the checks using Ansible provided modules.

Begin by updating the Keystone check to use 'os_auth' to fetch a token,
I think this is a good basic smoke test to verify Keystone is working.

Change-Id: I16049d9201fd8138c781ef2e1e0c1827ea817259
Partially-implements: blueprint sanity-check-container
2017-04-06 11:50:38 +00:00
Jenkins
7c7ead154d Merge "Use versionless keystone endpoints" 2017-04-05 04:51:33 +00:00
Eduardo Gonzalez
b14f1c5695 Use versionless keystone endpoints
nova quota fail to create due a recent change.
Keystone endpoint cannot have version v3 in the url.

During upgrade to Pike nova endpoint must be changed
to be versionless.

Change-Id: Idb433d526f7d44dfe4fd02ee918bd67e05c523f6
Depends-On: I568db4559428525ac6c5083cfc20cffc20be6342
Closes-Bug: #1668663
2017-03-19 12:30:33 +00:00
Jenkins
9e804f4286 Merge "Multi-regions Support" 2017-03-16 17:42:07 +00:00
caoyuan
1c4a5e50bd Add the missing port prechecks for keystone
Change-Id: Ic2890d0ea2dd0927b327b880bf25532fbb2efe07
2017-03-15 08:56:39 +00:00
rcherrueau
dcdbe44190
Multi-regions Support
Add support for basic multiple regions, that is to say, many OpenStack
with a shared Keystone (same users) and Horizon. The shared Keystone
and Horizon are deployed into one region, for instance RegionOne.
Services of other regions have an access to this Keystone. This
support assumes that the operator knows the name of all OpenStack
regions in advance, and considers as many Kolla runs as there are
regions.

The new variable, multiple_regions_names, contains the name of
regions. It is needed by the region that includes Keystone and
Horizon. In register.yml, it specifies to create as many Keystone
endpoints as there are regiones, so that services of other regions can
connect to Keystone. In local_settings.j2, it changes the render to
support multiple regions in Horizon. The multi-regions.rst explains
how to perform a multiple regions deployment.

Implements: blueprint multi-kolla-config
Change-Id: Icab2aebfc4de0e3bc609950956e0af397705f403
2017-03-10 14:24:42 +01:00
Jeffrey Zhang
47762d4850 Fix the failure when running precheck after deploy
* Move the tasks to the role
* Skip the task when container is already running

Change-Id: I1990d4dd2a02efa2b3766329000aa23419e0ff17
Closes-Bug: #1670286
2017-03-07 06:57:16 +00:00
Jenkins
d9740e9c40 Merge "Remove unnecessary until in register.yml file" 2017-02-22 12:28:06 +00:00
caoyuan
1c3c611f40 Add the missing condition for config.yml
- add "item.value.enabled | bool"
- add "| bool" to keystone
- add group check for searchlight

Change-Id: Id4555a0a96ea1670e99c88a1da9d3e07bf253497
2017-02-14 11:19:26 +08:00
Jeffrey Zhang
2b402ace4d Fix the WARNING in copy keystone domain task
Change-Id: I2bf2e8a6ba17c813bb2b9cdf05d3062f29d9fdf6
Closes-Bug: #1653168
2017-02-05 20:49:20 +08:00
Jeffrey Zhang
38ad05a872 Remove unnecessary until in register.yml file
Change-Id: I1577cc3afef4dadd3a188c8ba749c9cdfad313ae
2017-02-04 14:38:54 +08:00
Jenkins
8884422f3d Merge "Refactor register.yml files" 2017-01-26 18:48:59 +00:00
Jeffrey Zhang
8155d74d8d Refactor register.yml files
Co-Authored-By: Mauricio Lima <mauriciolimab@gmail.com>
Change-Id: I9a4a6b6523dee4b388513386b7d85d421f2b7b89
2017-01-26 17:10:27 +00:00
Borne Mace
bb475911d3 Fixed config generation to check correct actions
A config generation check was added to a few services but the action
name checked was "genconfig" where the kolla-ansible genconfig command
actually uses the action name "config".

Stop run the handlers when action is "config".

Co-Authored-By: Jeffrey Zhang <jeffrey.zhang@99cloud.net>
Partially-implements: blueprint better-reconfigure
Change-Id: I9d3be2f674087f340108b176c8e8e2209ffa8806
2017-01-24 11:43:05 +08:00
Eduardo Gonzalez
bb7b8d0837 Fix keystone reconfigure
Change-Id: I15c23a3445ab1cbc92c4c1258f37844bf244ebf0
Partically-implements: blueprint better-reconfigure
2017-01-18 14:56:58 +00:00