Merge "Add an additional validation to check ceph-ansible repository" into stable/train

This commit is contained in:
Zuul 2019-12-23 20:51:26 +00:00 committed by Gerrit Code Review
commit cb4899fd2f
3 changed files with 15 additions and 0 deletions

View File

@ -8,6 +8,7 @@
groups:
- pre-deployment
fail_without_ceph_ansible: false
ceph_ansible_repo: "centos-ceph-nautilus"
tasks:
- include_role:
name: ceph

View File

@ -3,4 +3,5 @@ fail_without_ceph_ansible: false
fail_without_deps: false
fail_on_ceph_health_err: false
osd_percentage_min: 0
ceph_ansible_repo: "centos-ceph-nautilus"

View File

@ -20,3 +20,16 @@
when:
- ceph_ansible_installed.stdout.find('is not installed') != -1
- fail_without_ceph_ansible|default(false)|bool
- name: Get ceph-ansible repository
shell: "yum info ceph-ansible | awk '/From repo/ {print $4}'"
register: repo
changed_when: False
- name: Fail if ceph-ansible doesn't belong to the specified repo
fail:
msg: "Make sure ceph-ansible package is installed from {{ ceph_ansible_repo }}"
when:
- fail_without_ceph_ansible|default(false)|bool
- (repo.stdout | length > 0 or repo.stdout != "{{ ceph_ansible_repo }}")