Prefix tasks with ostack versions

The DB migrations are using recurring task names,
making it difficult to isolate which version task ran.
The prefix of each task with the actual base OpenStack
version makes it easier to identify those, especially
in a leapfrog situation.

Change-Id: I9c2b711452208be28bef421a5e536bd2bf8a9a03
This commit is contained in:
Bjoern Teipel 2017-08-25 13:42:27 -05:00
parent 0a55f20565
commit 3966b98706
5 changed files with 90 additions and 90 deletions

View File

@ -13,49 +13,49 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set venv path
- name: "Kilo: Set venv path"
hosts: "keystone_all[0]:glance_all[0]:cinder_all[0]:nova_api_os_compute[0]:neutron_server[0]:heat_all[0]"
user: root
vars:
file_name: "{{ venv_tar_location | basename }}"
tasks:
- name: Set venv fact
- name: "Kilo: Set venv fact"
set_fact:
venv_path: "/opt/{{ file_name.split('.tgz')[0] }}"
- name: Keystone DB Migrations
- name: "Kilo: Keystone DB Migrations"
hosts: "keystone_all[0]"
user: root
tasks:
- name: Perform a Keystone DB sync 67
- name: "Kilo: Perform a Keystone DB sync 67"
command: "{{ venv_path }}/bin/keystone-manage db_sync"
- name: Glance DB Migrations
- name: "Kilo: Glance DB Migrations"
hosts: "glance_all[0]"
user: root
tasks:
- name: Perform a Glance DB sync
- name: "Kilo: Perform a Glance DB sync"
command: "{{ venv_path }}/bin/glance-manage db_sync"
- name: Cinder DB Migrations
- name: "Kilo: Cinder DB Migrations"
hosts: "cinder_all[0]"
user: root
tasks:
- name: Perform a cinder DB sync
- name: "Kilo: Perform a cinder DB sync"
command: "{{ venv_path }}/bin/cinder-manage db sync"
- name: Nova DB Migrations
- name: "Kilo: Nova DB Migrations"
hosts: "nova_api_os_compute[0]"
user: root
tasks:
- name: Perform a Nova DB sync
- name: "Kilo: Perform a Nova DB sync"
command: "{{ venv_path }}/bin/nova-manage db sync"
- name: Run nova flavor migrations
- name: "Kilo: Run nova flavor migrations"
command: "{{ venv_path }}/bin/nova-manage db migrate_flavor_data --force"
- name: Run nova null uuid checks
- name: "Kilo: Run nova null uuid checks"
command: "{{ venv_path }}/bin/nova-manage db null_instance_uuid_scan --delete"
- name: Neutron DB Migrations
- name: "Kilo: Neutron DB Migrations"
hosts: "neutron_server[0]"
user: root
vars:
@ -71,35 +71,35 @@
neutron_db_plugin: "/etc/neutron/{{ neutron_plugins[neutron_plugin_type | default('ml2')]['plugin_ini'] }}"
neutron_db_config: "/etc/neutron/neutron.conf"
tasks:
- name: Perform a Neutron DB Upgrade
- name: "Kilo: Perform a Neutron DB Upgrade"
command: "{{ venv_path }}/bin/neutron-db-manage --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade {{ neutron_db_revision }}"
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
- name: Check for DB revision
- name: "Kilo: Check for DB revision"
shell: "{{ venv_path }}/bin/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 }}"
- name: Perform a Neutron DB Stamp
- name: "Kilo: Perform a Neutron DB Stamp"
command: "{{ venv_path }}/bin/neutron-db-manage --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} stamp {{ neutron_db_revision }}"
when: neutron_dbmanage.rc != 0
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
- name: Heat DB Migrations
- name: "Kilo: Heat DB Migrations"
hosts: "heat_all[0]"
user: root
tasks:
- name: Perform a heat DB sync
- name: "Kilo: Perform a heat DB sync"
command: "{{ venv_path }}/bin/heat-manage db_sync"
- name: Horizon DB drop
- name: "Kilo: Horizon DB drop"
hosts: "utility_all[0]"
user: root
tasks:
- name: Drop horizon DB - It will be recreated later
- name: "Kilo: Drop horizon DB - It will be recreated later"
command: "mysql --unbuffered -sNL -e 'drop database {{ horizon_galera_database | default('dash') }}'"
register: drop_db
failed_when: false

View File

@ -13,57 +13,57 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set venv path
- name: "Liberty: Set venv path"
hosts: "keystone_all[0]:glance_all[0]:cinder_all[0]:nova_api_os_compute[0]:neutron_server[0]:heat_all[0]"
user: root
vars:
file_name: "{{ venv_tar_location | basename }}"
tasks:
- name: Set venv fact
- name: "Liberty: Set venv fact"
set_fact:
venv_path: "/opt/{{ file_name.split('.tgz')[0] }}"
- name: Keystone DB Migrations
- name: "Liberty: Keystone DB Migrations"
hosts: "keystone_all[0]"
user: root
tasks:
- name: Perform a Keystone DB sync
- name: "Liberty: Perform a Keystone DB sync"
command: "{{ venv_path }}/bin/keystone-manage db_sync 75"
- name: Glance DB Migrations
- name: "Liberty: Glance DB Migrations"
hosts: "glance_all[0]"
user: root
tasks:
- name: Perform a Glance DB sync
- name: "Liberty: Perform a Glance DB sync"
command: "{{ venv_path }}/bin/glance-manage db_sync"
- name: Cinder DB Migrations
- name: "Liberty: Cinder DB Migrations"
hosts: "cinder_all[0]"
user: root
tasks:
- name: Perform a cinder DB sync
- name: "Liberty: Perform a cinder DB sync"
command: "{{ venv_path }}/bin/cinder-manage db sync"
- name: Nova DB Migrations
- name: "Liberty: Nova DB Migrations"
hosts: "nova_api_os_compute[0]"
user: root
tasks:
- name: Run nova null uuid checks
- name: "Liberty: Run nova null uuid checks"
command: "{{ venv_path }}/bin/nova-manage db null_instance_uuid_scan --delete"
- name: Perform a Nova DB sync
- name: "Liberty: Perform a Nova DB sync"
command: "{{ venv_path }}/bin/nova-manage db sync"
- name: Stop Neutron Server
- name: "Liberty: Stop Neutron Server"
hosts: "neutron_server"
user: root
tasks:
- name: Stop Neutron server
- name: "Liberty: Stop Neutron server"
service:
name: "neutron-server"
state: stopped
pattern: "neutron-server"
- name: Neutron DB Migrations
- name: "Liberty: Neutron DB Migrations"
hosts: "neutron_server[0]"
user: root
vars:
@ -79,23 +79,23 @@
neutron_db_plugin: "/etc/neutron/{{ neutron_plugins[neutron_plugin_type | default('ml2')]['plugin_ini'] }}"
neutron_db_config: "/etc/neutron/neutron.conf"
tasks:
- name: Perform a Neutron DB Upgrade
- name: "Liberty: Perform a Neutron DB Upgrade"
command: "{{ venv_path }}/bin/neutron-db-manage --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade {{ neutron_db_revision }}"
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
- name: Heat DB Migrations
- name: "Liberty: Heat DB Migrations"
hosts: "heat_all[0]"
user: root
tasks:
- name: Perform a heat DB sync
- name: "Liberty: Perform a Heat DB sync"
command: "{{ venv_path }}/bin/heat-manage db_sync"
- name: Horizon DB drop
- name: "Liberty: Horizon DB drop"
hosts: "utility_all[0]"
user: root
tasks:
- name: Drop horizon DB - It will be recreated later
- name: "Liberty: Drop Horizon DB - It will be recreated later"
command: "mysql --unbuffered -sNL -e 'drop database {{ horizon_galera_database | default('dash') }}'"
register: drop_db
failed_when: false

View File

@ -13,59 +13,59 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set venv path
- name: "Mitaka: Set venv path"
hosts: "keystone_all[0]:glance_all[0]:cinder_all[0]:nova_api_os_compute[0]:neutron_server[0]:heat_all[0]:ironic_conductor[0]"
user: root
vars:
file_name: "{{ venv_tar_location | basename }}"
tasks:
- name: Set venv fact
- name: "Mitaka: Set venv fact"
set_fact:
venv_path: "/opt/{{ file_name.split('.tgz')[0] }}"
- name: Keystone DB Migrations
- name: "Mitaka: Keystone DB Migrations"
hosts: "keystone_all[0]"
user: root
tasks:
- name: Perform a Keystone DB sync
- name: "Mitaka: Perform a Keystone DB sync"
command: "{{ venv_path }}/bin/keystone-manage db_sync"
- name: Glance DB Migrations
- name: "Mitaka: Glance DB Migrations"
hosts: "glance_all[0]"
user: root
tasks:
- name: Perform a Glance DB sync
- name: "Mitaka: Perform a Glance DB sync"
command: "{{ venv_path }}/bin/glance-manage db_sync"
- name: Cinder DB Migrations
- name: "Mitaka: Cinder DB Migrations"
hosts: "cinder_all[0]"
user: root
tasks:
- name: Perform a cinder DB sync
- name: "Mitaka: Perform a cinder DB sync"
command: "{{ venv_path }}/bin/cinder-manage db sync"
- name: Nova DB Migrations
- name: "Mitaka: Nova DB Migrations"
hosts: "nova_api_os_compute[0]"
user: root
tasks:
- name: Run nova null uuid checks
- name: "Mitaka: Run nova null uuid checks"
command: "{{ venv_path }}/bin/nova-manage db null_instance_uuid_scan --delete"
- name: Perform a Nova DB sync
- name: "Mitaka: Perform a Nova DB sync"
command: "{{ venv_path }}/bin/nova-manage db sync"
- name: Perform Nova online data migrations
- name: "Mitaka: Perform Nova online data migrations"
command: "{{ venv_path }}/bin/nova-manage db online_data_migrations"
- name: Stop Neutron Server
- name: "Mitaka: Stop Neutron Server"
hosts: "neutron_server"
user: root
tasks:
- name: Stop Neutron server
- name: "Mitaka: Stop Neutron server"
service:
name: "neutron-server"
state: stopped
pattern: "neutron-server"
- name: Neutron DB Migrations
- name: "Mitaka: Neutron DB Migrations"
hosts: "neutron_server[0]"
user: root
vars:
@ -83,31 +83,31 @@
neutron_db_plugin: "/etc/neutron/{{ neutron_plugins[neutron_plugin_type | default('ml2')]['plugin_ini'] }}"
neutron_db_config: "/etc/neutron/neutron.conf"
tasks:
- name: Perform a Neutron DB Upgrade
- name: "Mitaka: Perform a Neutron DB Upgrade"
command: "{{ venv_path }}/bin/neutron-db-manage --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade {{ neutron_db_revision }}"
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
- name: Heat DB Migrations
- name: "Mitaka: Heat DB Migrations"
hosts: "heat_all[0]"
user: root
tasks:
- name: Perform a heat DB sync
- name: "Mitaka: Perform a Heat DB sync"
command: "{{ venv_path }}/bin/heat-manage db_sync"
- name: Horizon DB drop
- name: "Mitaka: Horizon DB drop"
hosts: "utility_all[0]"
user: root
tasks:
- name: Drop horizon DB - It will be recreated later
- name: "Mitaka: Drop horizon DB - It will be recreated later"
command: "mysql --unbuffered -sNL -e 'drop database {{ horizon_galera_database | default('dash') }}'"
register: drop_db
failed_when: false
changed_when: drop_db.rc == 0
- name: Ironic DB Migrations
- name: "Mitaka: Ironic DB Migrations"
hosts: "ironic_conductor[0]"
user: root
tasks:
- name: Update database schema
- name: "Mitaka: Update database schema"
command: "{{ venv_path }}/ironic-dbsync upgrade"

View File

@ -13,71 +13,71 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Set venv path
- name: "Newton: Set venv path"
hosts: "keystone_all[0]:glance_all[0]:cinder_all[0]:nova_api_os_compute[0]:neutron_server[0]:heat_all[0]:ironic_conductor[0]:aodh_all[0]"
user: root
vars:
file_name: "{{ venv_tar_location | basename }}"
tasks:
- name: Set venv fact
- name: "Newton: Set venv fact"
set_fact:
venv_path: "/opt/{{ file_name.split('.tgz')[0] }}"
- name: Keystone DB Migrations
- name: "Newton: Keystone DB Migrations"
hosts: "keystone_all[0]"
user: root
tasks:
- name: Perform a Keystone DB sync
- name: "Newton: Perform a Keystone DB sync"
command: "{{ venv_path }}/bin/keystone-manage db_sync"
- name: Glance DB Migrations
- name: "Newton: Glance DB Migrations"
hosts: "glance_all[0]"
user: root
tasks:
- name: Perform a Glance DB sync
- name: "Newton: Perform a Glance DB sync"
command: "{{ venv_path }}/bin/glance-manage db_sync"
- name: Cinder DB Migrations
- name: "Newton: Cinder DB Migrations"
hosts: "cinder_all[0]"
user: root
tasks:
- name: Check the service list
- name: "Newton: Check the service list"
shell: mysql -Be 'select `binary`,`host` from services;' cinder | awk '{if (NR!=1) {print $1, $2}}'
args:
executable: /bin/bash
changed_when: false
delegate_to: "{{ groups['utility_all'][0] }}"
register: cinder_service_list
- name: Perform a cinder DB sync
- name: "Newton: Perform a cinder DB sync"
command: "{{ venv_path }}/bin/cinder-manage db sync"
- name: Perform service purge
- name: "Newton: Perform service purge"
shell: "{{ venv_path }}/bin/cinder-manage service remove {{ item }}"
args:
executable: /bin/bash
with_items: "{{ cinder_service_list.stdout_lines }}"
- name: Nova DB Migrations
- name: "Newton: Nova DB Migrations"
hosts: "nova_api_os_compute[0]"
user: root
tasks:
- name: Run nova null uuid checks
- name: "Newton: Run nova null uuid checks"
command: "{{ venv_path }}/bin/nova-manage db null_instance_uuid_scan --delete"
- name: Perform a Nova DB sync
- name: "Newton: Perform a Nova DB sync"
command: "{{ venv_path }}/bin/nova-manage db sync"
- name: Perform Nova online data migrations
- name: "Newton: Perform Nova online data migrations"
command: "{{ venv_path }}/bin/nova-manage db online_data_migrations"
- name: Stop Neutron Server
- name: "Newton: Stop Neutron Server"
hosts: "neutron_server"
user: root
tasks:
- name: Stop Neutron server
- name: "Newton: Stop Neutron server"
service:
name: "neutron-server"
state: stopped
pattern: "neutron-server"
- name: Neutron DB Migrations
- name: "Newton: Neutron DB Migrations"
hosts: "neutron_server[0]"
user: root
vars:
@ -99,38 +99,38 @@
neutron_db_plugin: "/etc/neutron/{{ neutron_plugins[neutron_plugin_type | default('ml2.lxb')]['plugin_ini'] }}"
neutron_db_config: "/etc/neutron/neutron.conf"
tasks:
- name: Perform a Neutron DB Upgrade
- name: "Newton: Perform a Neutron DB Upgrade"
command: "{{ venv_path }}/bin/neutron-db-manage --config-file {{ neutron_db_config }} --config-file {{ neutron_db_plugin }} upgrade {{ neutron_db_revision }}"
sudo: yes
sudo_user: "{{ neutron_system_user_name }}"
- name: Heat DB Migrations
- name: "Newton: Heat DB Migrations"
hosts: "heat_all[0]"
user: root
tasks:
- name: Perform a heat DB sync
- name: "Newton: Perform a Heat DB sync"
command: "{{ venv_path }}/bin/heat-manage db_sync"
- name: Horizon DB drop
- name: "Newton: Horizon DB drop"
hosts: "utility_all[0]"
user: root
tasks:
- name: Drop horizon DB - It will be recreated later
- name: "Newton: Drop horizon DB - It will be recreated later"
command: "mysql --unbuffered -sNL -e 'drop database {{ horizon_galera_database | default('dash') }}'"
register: drop_db
failed_when: false
changed_when: drop_db.rc == 0
- name: AODH DB Migrations
- name: "Newton: Aodh DB Migrations"
hosts: "aodh_all[0]"
user: root
tasks:
- name: Perform a Aodh DB sync
- name: "Newton: Perform a Aodh DB sync"
command: "{{ aodh_bin }}/aodh-dbsync"
- name: Ironic DB Migrations
- name: "Newton: Ironic DB Migrations"
hosts: "ironic_conductor[0]"
user: root
tasks:
- name: Update database schema
- name: "Newton: Update database schema"
command: "{{ venv_path }}/ironic-dbsync upgrade"

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Update neutron MTU for vlan, vxlan, and flat networks
- name: "Mitaka: Update neutron MTU for vlan, vxlan, and flat networks"
hosts: galera_all[0]
gather_facts: false
user: root
@ -25,7 +25,7 @@
-e "SELECT network_id, network_type, physical_network FROM ml2_network_segments WHERE network_type IN ('vlan','flat','vxlan','gre') AND network_id IN (select id from networks where mtu=0);" {{ neutron_galera_database | default('neutron') }} | tr "\t" "|"
register: networks
- name: Create neutron MTU migration script
- name: "Mitaka: Create neutron MTU migration script"
copy:
content: |
{% for item in networks.stdout_lines %}
@ -75,5 +75,5 @@
{% endfor %}
dest: /tmp/neutron-mtu-script.sh
- name: Run neutron MTU migration script
- name: "Mitaka: Run neutron MTU migration script:
command: bash /tmp/neutron-mtu-script.sh