From 075b1a94d5202b5a5ea659a354af10229baa6eeb Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Thu, 5 Aug 2021 20:17:10 +0430 Subject: [PATCH] ceph-validate: export validate repository vars as a task Signed-off-by: Seena Fallah (cherry picked from commit 4f6da9d92ff264e05dbcd7c9d36398acd1692935) --- .../ceph-validate/tasks/check_repository.yml | 19 ++++++++++++ roles/ceph-validate/tasks/main.yml | 29 +------------------ 2 files changed, 20 insertions(+), 28 deletions(-) create mode 100644 roles/ceph-validate/tasks/check_repository.yml diff --git a/roles/ceph-validate/tasks/check_repository.yml b/roles/ceph-validate/tasks/check_repository.yml new file mode 100644 index 0000000000..affcb12d4a --- /dev/null +++ b/roles/ceph-validate/tasks/check_repository.yml @@ -0,0 +1,19 @@ +- name: validate ceph_origin + fail: + msg: "ceph_origin must be either 'repository', 'distro' or 'local'" + when: ceph_origin not in ['repository', 'distro', 'local'] + +- name: validate ceph_repository + fail: + msg: "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'" + when: + - ceph_origin == 'repository' + - ceph_repository not in ['community', 'rhcs', 'dev', 'custom', 'uca'] + +- name: validate ceph_repository_community + fail: + msg: "ceph_stable_release must be 'octopus'" + when: + - ceph_origin == 'repository' + - ceph_repository == 'community' + - ceph_stable_release not in ['octopus'] diff --git a/roles/ceph-validate/tasks/main.yml b/roles/ceph-validate/tasks/main.yml index 0658f43186..9a24cc8885 100644 --- a/roles/ceph-validate/tasks/main.yml +++ b/roles/ceph-validate/tasks/main.yml @@ -3,35 +3,8 @@ include_tasks: check_system.yml - name: validate repository variables in non-containerized scenario + include_tasks: check_repository.yml when: not containerized_deployment | bool - block: - - name: validate ceph_origin - fail: - msg: "ceph_origin must be either 'repository', 'distro' or 'local'" - when: ceph_origin not in ['repository', 'distro', 'local'] - - - name: validate ceph_repository - fail: - msg: "ceph_repository must be either 'community', 'rhcs', 'dev', 'custom' or 'uca'" - when: - - ceph_origin == 'repository' - - ceph_repository not in ['community', 'rhcs', 'dev', 'custom', 'uca'] - - - name: validate ceph_repository_community - fail: - msg: "ceph_stable_release must be either 'nautilus' or 'octopus'" - when: - - ceph_origin == 'repository' - - ceph_repository == 'community' - - ceph_stable_release not in ['nautilus', 'octopus'] - - - name: validate ceph_repository_type - fail: - msg: "ceph_repository_type must be either 'cdn' or 'iso'" - when: - - ceph_origin == 'repository' - - ceph_repository == 'rhcs' - - ceph_repository_type not in ['cdn', 'iso'] - name: validate osd_objectstore fail: