Add option to fail if ceph-ansible is not installed

If someone is deploying Ceph then they need ceph-ansible.
The warning might be overlooked and the user may end up
with a message about a missing file. If Ceph is being
deployed then we want to make the validation fail the
deployment if ceph-ansible is not installed so that the
user has a better error message to follow in order to debug.

Also, update warning to refer to the ceph-ansible package.

Change-Id: Ic099c61c74abf6da24a2cce899c944e3bf8ce26b
This commit is contained in:
John Fulton 2019-05-31 18:46:20 +00:00
parent b8aa827047
commit bf206aa97a
3 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,7 @@
Prints a message if ceph-ansible isn't installed
groups:
- pre-deployment
fail_without_ceph_ansible: false
tasks:
- include_role:
name: ceph

View File

@ -0,0 +1,2 @@
---
fail_without_ceph_ansible: false

View File

@ -9,6 +9,14 @@
- name: Warn about missing ceph-ansible
warn:
msg: If planning to use Ceph, it is necessary to install the ceph-ansible on the undercloud
msg: If planning to use Ceph, it is necessary to install the ceph-ansible package on the undercloud
when:
- ceph_ansible_installed.stdout.find('is not installed') != -1
- not fail_without_ceph_ansible|default(false)|bool
- name: Fail if ceph-ansible is missing
fail:
msg: If planning to use Ceph, it is necessary to install the ceph-ansible package on the undercloud
when:
- ceph_ansible_installed.stdout.find('is not installed') != -1
- fail_without_ceph_ansible|default(false)|bool