Add support for placement_database and cell_v2

This patch adds support for the cell0 database creation, and adjusts the
mysql-db-user.yml playbook to allow append_privs to be specified using
the "db_append_privs" var - defaulting to "omit".

The nova_placement_database is created as is the nova_cell0 database
which has permissions for the nova_api user.

Lastly there is a work around for bugfix:
https://review.openstack.org/#/c/428120/

Once that merges we can remove the "reserved_host_disk_mb: 0" setting.

Change-Id: I5fab3fbe982e12ca05adc051533f81da1093f7c0
This commit is contained in:
Andy McCrae 2017-02-02 14:32:40 +00:00
parent b0b7e3ec29
commit e0cc789dd1
3 changed files with 24 additions and 0 deletions

View File

@ -32,5 +32,6 @@
host: "{{ item }}"
state: "present"
priv: "{{ db_name }}.*:ALL"
append_privs: "{{ db_append_privs | default(omit) }}"
delegate_to: "{{ groups['galera_all'][0] }}"
with_items: "{{ grant_list | default(['localhost', '%']) }}"

View File

@ -26,3 +26,6 @@ nova_package_state: "{{ package_state }}"
nova_venv_tag: "{{ venv_tag }}"
nova_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin"
nova_venv_download_url: "{{ venv_base_download_url }}/nova-{{ openstack_release }}-{{ ansible_architecture | lower }}.tgz"
# TODO: (andymccr) remove this once https://review.openstack.org/#/c/428120/ merges
nova_reserved_host_disk_mb: 0

View File

@ -67,6 +67,23 @@
login_host: "{{ nova_api_galera_address }}"
db_name: "{{ nova_api_galera_database }}"
when: inventory_hostname == groups['nova_all'][0]
- include: common-tasks/mysql-db-user.yml
static: no
vars:
user_name: "{{ nova_placement_galera_user }}"
password: "{{ nova_placement_container_mysql_password }}"
login_host: "{{ nova_placement_galera_address }}"
db_name: "{{ nova_placement_galera_database }}"
when: inventory_hostname == groups['nova_all'][0]
- include: common-tasks/mysql-db-user.yml
static: no
vars:
user_name: "{{ nova_api_galera_user }}"
password: "{{ nova_api_container_mysql_password }}"
login_host: "{{ nova_api_galera_address }}"
db_name: "{{ nova_cell0_database }}"
db_append_privs: "yes"
when: inventory_hostname == groups['nova_all'][0]
- include: common-tasks/package-cache-proxy.yml
- name: Add nbd devices to the compute
@ -181,6 +198,9 @@
nova_galera_database: nova
nova_api_galera_user: nova_api
nova_api_galera_database: nova_api
nova_placement_galera_user: nova_placement
nova_placement_galera_database: nova_placement
nova_cell0_database: nova_cell0
nova_galera_address: "{{ galera_address }}"
nova_api_galera_address: "{{ galera_address }}"
nova_placement_galera_address: "{{ galera_address }}"