Updated master for new dev work - Liberty-2

Update all branches to Liberty-2.

Also, as of Change ID I3823900bc5aaf7757c37edb804027cf4d9c757ab
the new neutron releases have a new db upgrade and stamp process
in order for these version to be rev'd we need to incorporate
those change. As such the neutron_db_setup.yml has been updated
along with the neutron `neutron_db_revision` default variable.

Change-Id: Icfb75d377498e288e67be1a8bc049b42d8aa57b1
This commit is contained in:
kevin 2015-07-07 09:26:04 -05:00 committed by Jesse Pretorius
parent ae11efc9ca
commit 37e42c4b64
2 changed files with 42 additions and 14 deletions

View File

@ -32,7 +32,7 @@ neutron_system_home_folder: "/var/lib/{{ neutron_system_user_name }}"
neutron_galera_user: neutron
neutron_galera_password: "{{ neutron_container_mysql_password }}"
neutron_galera_database: neutron
neutron_db_revision: head
neutron_db_revision: heads
neutron_db_config: /etc/neutron/neutron.conf
neutron_db_plugin: /etc/neutron/plugins/ml2/ml2_conf.ini
neutron_db_max_overflow: 20

View File

@ -39,6 +39,41 @@
tags:
- neutron-db-setup
- name: Inspect on disk neutron DB revision
command: >
cat {{ neutron_system_home_folder }}/neutron-revision
failed_when: false
changed_when: neutron_revision_on_disk.rc != 0
register: neutron_revision_on_disk
tags:
- neutron-db-setup
- neutron-upgrade
- neutron-stamp
- name: Check last DB revision
shell: |
neutron-db-manage history | head -1 | tee {{ neutron_system_home_folder }}/neutron-revision
register: neutron_revision
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
delegate_to: "{{ item }}"
with_items: groups['neutron_all']
tags:
- neutron-db-setup
- neutron-upgrade
- neutron-stamp
- name: Stop neutron server
service:
name: "neutron-server"
state: stopped
pattern: "neutron-server"
ignore_errors: true
when: neutron_revision.results.0.stdout != neutron_revision_on_disk.stdout
tags:
- neutron-db-setup
- neutron-stamp
- name: Perform a Neutron DB Upgrade
command: |
neutron-db-manage --config-file {{ neutron_db_config }}
@ -46,21 +81,12 @@
upgrade {{ neutron_db_revision }}
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
when: >
neutron_revision.results.0.stdout != neutron_revision_on_disk.stdout
notify: Restart neutron services
tags:
- neutron-db-setup
- neutron-upgrade
# This is using shell because we are grep-ing
- name: Check for DB revision
shell: |
neutron-db-manage history | grep -w 'Revision ID: {{ neutron_db_revision }}'
register: neutron_dbmanage
failed_when: false
changed_when: neutron_dbmanage.rc != 0
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
tags:
- neutron-db-setup
- neutron-stamp
- name: Perform a Neutron DB Stamp
@ -68,9 +94,11 @@
neutron-db-manage --config-file {{ neutron_db_config }}
--config-file {{ neutron_db_plugin }}
stamp {{ neutron_db_revision }}
when: neutron_dbmanage.rc != 0
when: neutron_revision.results.0.stdout != neutron_revision_on_disk.stdout
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
notify: Restart neutron services
tags:
- neutron-db-setup
- neutron-upgrade
- neutron-stamp