From 906495403ebe5ba0a48c5180e93b4eb207c7efbc Mon Sep 17 00:00:00 2001 From: Francesco Pantano Date: Fri, 24 Jan 2020 17:50:09 +0100 Subject: [PATCH] Sync 'validations/ceph-dependencies-installed.yaml' with the new role Change-Id: I85d09955e839bab35cc06d2f0906f3012c8a1aa9 (cherry picked from commit 33c42a304f61e537d64a0421041690888ac3b3e8) --- validations/ceph-dependencies-installed.yaml | 39 ++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 validations/ceph-dependencies-installed.yaml diff --git a/validations/ceph-dependencies-installed.yaml b/validations/ceph-dependencies-installed.yaml new file mode 100644 index 000000000..39aadc4dc --- /dev/null +++ b/validations/ceph-dependencies-installed.yaml @@ -0,0 +1,39 @@ +--- +- hosts: overcloud + vars: + metadata: + name: Check if Ceph dependencies are installed + description: > + Prints a message if a ceph dependency is missed + groups: + - pre-deployment + fail_without_deps: true + tripleo_delegate_to: "{{ groups['overcloud'] | default([]) }}" + packages: + - lvm2 + tasks: + - name: Gather the package facts + package_facts: + manager: auto + + - name: Warn about missing dependencies + warn: + msg: "If planning to use Ceph, it is necessary to check {{ item[0] }} is installed!" + when: + - "'{{ item[0] }}' not in ansible_facts.packages" + - not fail_without_deps|default(false)|bool + delegate_to: "{{ item[1] }}" + with_nested: + - "{{ packages }}" + - "{{ tripleo_delegate_to }}" + + - name: Fail if a ceph dependency is missing + fail: + msg: "If planning to use Ceph, it is necessary to install {{ item[0] }} package" + when: + - "'{{ item[0] }}' not in ansible_facts.packages" + - fail_without_deps|default(false)|bool + delegate_to: "{{ item[1] }}" + with_nested: + - "{{ packages }}" + - "{{ tripleo_delegate_to }}"