Merge "Simplify fact setting"
This commit is contained in:
commit
30eba1bf16
@ -13,6 +13,18 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
|
- name: Record the installation method
|
||||||
|
ini_file:
|
||||||
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||||
|
section: "cinder"
|
||||||
|
option: "install_method"
|
||||||
|
value: "{{ cinder_install_method }}"
|
||||||
|
|
||||||
|
- name: Refresh local facts to ensure the cinder section is present
|
||||||
|
setup:
|
||||||
|
filter: ansible_local
|
||||||
|
gather_subset: "!all"
|
||||||
|
|
||||||
- name: Install distro packages
|
- name: Install distro packages
|
||||||
package:
|
package:
|
||||||
name: "{{ cinder_package_list }}"
|
name: "{{ cinder_package_list }}"
|
||||||
@ -28,26 +40,16 @@
|
|||||||
include_tasks: cinder_install_source.yml
|
include_tasks: cinder_install_source.yml
|
||||||
when: cinder_install_method == 'source'
|
when: cinder_install_method == 'source'
|
||||||
|
|
||||||
- name: Initialise the upgrade facts
|
- name: Set the upgrade facts
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||||
section: cinder
|
section: cinder
|
||||||
option: "{{ item.name }}"
|
option: "{{ item }}"
|
||||||
value: "{{ item.state }}"
|
value: true
|
||||||
with_items:
|
with_items:
|
||||||
- name: "need_online_data_migrations"
|
- "need_online_data_migrations"
|
||||||
state: "True"
|
- "need_service_restart"
|
||||||
- name: "need_service_restart"
|
when:
|
||||||
state: "True"
|
|
||||||
- name: "install_method"
|
|
||||||
state: "{{ cinder_install_method }}"
|
|
||||||
when: (cinder_install_method == 'source' and
|
|
||||||
((cinder_get_venv | changed) or
|
|
||||||
(cinder_venv_dir | changed))) or
|
|
||||||
(install_packages | changed) or
|
(install_packages | changed) or
|
||||||
(ansible_local is not defined) or
|
|
||||||
('openstack_ansible' not in ansible_local) or
|
|
||||||
('cinder' not in ansible_local['openstack_ansible']) or
|
|
||||||
('need_online_data_migrations' not in ansible_local['openstack_ansible']['cinder']) or
|
('need_online_data_migrations' not in ansible_local['openstack_ansible']['cinder']) or
|
||||||
('need_service_restart' not in ansible_local['openstack_ansible']['cinder']) or
|
('need_service_restart' not in ansible_local['openstack_ansible']['cinder'])
|
||||||
('install_method' not in ansible_local['openstack_ansible']['cinder'])
|
|
||||||
|
@ -120,6 +120,20 @@
|
|||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
|
||||||
|
- name: Initialise the upgrade facts
|
||||||
|
ini_file:
|
||||||
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||||
|
section: cinder
|
||||||
|
option: "{{ item }}"
|
||||||
|
value: true
|
||||||
|
with_items:
|
||||||
|
- "need_online_data_migrations"
|
||||||
|
- "need_service_restart"
|
||||||
|
when: (cinder_get_venv | changed) or
|
||||||
|
(cinder_venv_dir | changed) or
|
||||||
|
('need_online_data_migrations' not in ansible_local['openstack_ansible']['cinder']) or
|
||||||
|
('need_service_restart' not in ansible_local['openstack_ansible']['cinder'])
|
||||||
|
|
||||||
- name: Record the venv tag deployed
|
- name: Record the venv tag deployed
|
||||||
ini_file:
|
ini_file:
|
||||||
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
dest: "/etc/ansible/facts.d/openstack_ansible.fact"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user