Skip to content

Commit

Permalink
ceph-validate: export validate repository vars as a task
Browse files Browse the repository at this point in the history
Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit 4f6da9d)
  • Loading branch information
clwluvw authored and guits committed Oct 18, 2021
1 parent 110b08c commit 075b1a9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
19 changes: 19 additions & 0 deletions roles/ceph-validate/tasks/check_repository.yml
Original file line number Diff line number Diff line change
@@ -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']
29 changes: 1 addition & 28 deletions roles/ceph-validate/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 075b1a9

Please sign in to comment.