Factor out OpenStack release detection playbook
We copy-paste the same play into various playbooks to detect openstack_release. This change factors that code into a separate playbook that is imported. Change-Id: I5fea005642b960080bf5e43455618dc24766c386
This commit is contained in:
parent
4f21133ac4
commit
fca91fe83e
@ -1,19 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Detect openstack_release variable
|
- import_playbook: detect-release.yml
|
||||||
hosts: bifrost
|
vars:
|
||||||
gather_facts: false
|
detect_release_hosts: bifrost
|
||||||
tasks:
|
|
||||||
- name: Get current kolla-ansible version number
|
|
||||||
local_action: command python -c "import pbr.version; print(pbr.version.VersionInfo('kolla-ansible'))"
|
|
||||||
register: kolla_ansible_version
|
|
||||||
changed_when: false
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
|
|
||||||
- name: Set openstack_release variable
|
|
||||||
set_fact:
|
|
||||||
openstack_release: "{{ kolla_ansible_version.stdout }}"
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
- name: Apply role bifrost
|
- name: Apply role bifrost
|
||||||
hosts: bifrost
|
hosts: bifrost
|
||||||
|
16
ansible/detect-release.yml
Normal file
16
ansible/detect-release.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
- name: Detect openstack_release variable
|
||||||
|
hosts: "{{ detect_release_hosts }}"
|
||||||
|
gather_facts: false
|
||||||
|
tasks:
|
||||||
|
- name: Get current kolla-ansible version number
|
||||||
|
local_action: command python -c "import pbr.version; print(pbr.version.VersionInfo('kolla-ansible'))"
|
||||||
|
register: kolla_ansible_version
|
||||||
|
changed_when: false
|
||||||
|
when: openstack_release == "auto"
|
||||||
|
|
||||||
|
- name: Set openstack_release variable
|
||||||
|
set_fact:
|
||||||
|
openstack_release: "{{ kolla_ansible_version.stdout }}"
|
||||||
|
when: openstack_release == "auto"
|
||||||
|
tags: always
|
@ -1,19 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Detect openstack_release variable
|
- import_playbook: detect-release.yml
|
||||||
hosts: mariadb
|
vars:
|
||||||
gather_facts: false
|
detect_release_hosts: mariadb
|
||||||
tasks:
|
|
||||||
- name: Get current kolla-ansible version number
|
|
||||||
local_action: command python -c "import pbr.version; print(pbr.version.VersionInfo('kolla-ansible'))"
|
|
||||||
register: kolla_ansible_version
|
|
||||||
changed_when: false
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
|
|
||||||
- name: Set openstack_release variable
|
|
||||||
set_fact:
|
|
||||||
openstack_release: "{{ kolla_ansible_version.stdout }}"
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
- name: Backup MariaDB
|
- name: Backup MariaDB
|
||||||
hosts: mariadb
|
hosts: mariadb
|
||||||
|
@ -1,19 +1,7 @@
|
|||||||
---
|
---
|
||||||
- name: Detect openstack_release variable
|
- import_playbook: detect-release.yml
|
||||||
hosts: mariadb
|
vars:
|
||||||
gather_facts: false
|
detect_release_hosts: mariadb
|
||||||
tasks:
|
|
||||||
- name: Get current kolla-ansible version number
|
|
||||||
local_action: command python -c "import pbr.version; print(pbr.version.VersionInfo('kolla-ansible'))"
|
|
||||||
register: kolla_ansible_version
|
|
||||||
changed_when: false
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
|
|
||||||
- name: Set openstack_release variable
|
|
||||||
set_fact:
|
|
||||||
openstack_release: "{{ kolla_ansible_version.stdout }}"
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
- name: Recover mariadb
|
- name: Recover mariadb
|
||||||
hosts: mariadb
|
hosts: mariadb
|
||||||
|
@ -32,21 +32,9 @@
|
|||||||
- (ansible_play_batch | length) != (groups['all'] | length)
|
- (ansible_play_batch | length) != (groups['all'] | length)
|
||||||
tags: always
|
tags: always
|
||||||
|
|
||||||
- name: Detect openstack_release variable
|
- import_playbook: detect-release.yml
|
||||||
hosts: all
|
vars:
|
||||||
gather_facts: false
|
detect_release_hosts: all
|
||||||
tasks:
|
|
||||||
- name: Get current kolla-ansible version number
|
|
||||||
local_action: command python -c "import pbr.version; print(pbr.version.VersionInfo('kolla-ansible'))"
|
|
||||||
register: kolla_ansible_version
|
|
||||||
changed_when: false
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
|
|
||||||
- name: Set openstack_release variable
|
|
||||||
set_fact:
|
|
||||||
openstack_release: "{{ kolla_ansible_version.stdout }}"
|
|
||||||
when: openstack_release == "auto"
|
|
||||||
tags: always
|
|
||||||
|
|
||||||
- name: Apply role prechecks
|
- name: Apply role prechecks
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
Loading…
x
Reference in New Issue
Block a user