openstack-ansible-os_glance/tasks/glance_db_setup.yml
Jesse Pretorius (odyssey4me) 9a8481bc26 Revert "Only sync glance database on major versions"
The current major upgrade detection compares
the same variable against itself. It also takes
place after the new venv tag has been placed
and the local facts are refreshed so there's
no good way to figure out the origin version.

Additionally, the version_compare filter only
works with semver version strings which is
unnecessarily strict.

Additionally, there does not appear to be any
evidence in the glance documentation that
the db sync action requires services to be
shut down or any other orchestration, so the
previously implemented action of doing a db
sync on every playbook execution should be
just fine. If there is nothing for it to do (which
will be the case for a minor upgrade) then it
will do nothing. If there is something for it to
do (which will be the case for a major upgrade)
then it will do what needs to be done.

As such, there appears to be no point in
implementing this extra set of tasks and
conditionals.

This reverts commit 647c4e33f1.

Change-Id: I3b5afae3b7abf58de0b71ec2e67df2c38b6da5e3
2017-07-12 11:43:39 +01:00

27 lines
972 B
YAML

---
# Copyright 2014, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Perform a Glance DB sync
command: "{{ glance_bin }}/glance-manage db_sync"
become: yes
become_user: "{{ glance_system_user_name }}"
changed_when: false
- name: Load glance metadata definitions
command: "{{ glance_bin }}/glance-manage db_load_metadefs {{ glance_etc_dir }}/metadefs"
become: yes
become_user: "{{ glance_system_user_name }}"
changed_when: false