67e5da4005
This patch uses 'rpm' command to know if the ceph-ansible package is installed Whatever the return code, the command will return: - 'package ceph-ansible is not installed' or - 'ceph-ansible-3.1.9-1.el7.noarch' Adding '|| true' to the rpm command will get rid of the message 'exited with code: 1: non-zero return code' when ceph-ansible is not installed. Change-Id: Ida251a81d0fe7b6904f43b4f78f2f4e26d93325a Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
24 lines
661 B
YAML
24 lines
661 B
YAML
---
|
|
- hosts: undercloud
|
|
vars:
|
|
metadata:
|
|
name: Check if ceph-ansible is installed on the undercloud
|
|
description: >
|
|
Prints a message if ceph-ansible isn't installed
|
|
groups:
|
|
- pre-deployment
|
|
tasks:
|
|
- name: Check if ceph-ansible is installed
|
|
shell: rpm -q ceph-ansible || true
|
|
args:
|
|
warn: no
|
|
changed_when: False
|
|
ignore_errors: True
|
|
register: ceph_ansible_installed
|
|
|
|
- name: Warn about missing ceph-ansible
|
|
warn:
|
|
msg: If planning to use Ceph, it is necessary to install the ceph-ansible on the undercloud
|
|
when:
|
|
- ceph_ansible_installed.stdout.find('is not installed') != -1
|