Sync 'validations/ceph-ansible-installed.yaml' with the new role

Change-Id: I21513d005bb6dd45da45b1b3459f851acd30ebe1
This commit is contained in:
Francesco Pantano 2020-01-24 16:28:14 +01:00
parent ffd651f782
commit 716a308323
No known key found for this signature in database
GPG Key ID: 799868C47301D458
1 changed files with 13 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_tasks: tasks/deprecation.yaml
- name: Check if ceph-ansible is installed
@ -31,3 +32,15 @@
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:
- (repo.stdout | length == 0 or repo.stdout != "{{ ceph_ansible_repo }}")
- fail_without_ceph_ansible|default(false)|bool