ceph-ansible/roles/ceph-common/tasks/checks/check_mandatory_vars.yml

128 lines
4.0 KiB
YAML

---
- name: make sure an installation origin was chosen
fail:
msg: "choose an installation origin"
when:
- ceph_origin != 'upstream'
- ceph_origin != 'distro'
- ceph_origin != 'local'
tags:
- package-install
- name: make sure an installation source was chosen
fail:
msg: "choose an upstream installation source or read https://github.com/ceph/ceph-ansible/wiki"
when:
- ceph_origin == 'upstream'
- not ceph_stable
- not ceph_dev
- not ceph_stable_rh_storage
- not ceph_stable_uca
tags:
- package-install
- name: verify that a method was chosen for red hat storage
fail:
msg: "choose between ceph_stable_rh_storage_cdn_install and ceph_stable_rh_storage_iso_install"
when:
- ceph_stable_rh_storage
- not ceph_stable_rh_storage_cdn_install
- not ceph_stable_rh_storage_iso_install
- ceph_origin == "upstream"
tags:
- package-install
- name: make sure journal_size configured
debug:
msg: "WARNING: journal_size is configured to less than 5GB. This is not recommended and can lead to severe issues."
when:
- journal_size|int < 5120
- osd_objectstore != 'bluestore'
- osd_group_name in group_names
- name: make sure monitor_interface or monitor_address is configured
fail:
msg: "monitor_interface or monitor_address must be configured. Interface for the monitor to listen on or IP address of that interface"
when:
- monitor_interface == 'interface'
- monitor_address == '0.0.0.0'
- mon_group_name in group_names
- name: make sure cluster_network configured
fail:
msg: "cluster_network must be configured. Ceph replication network"
when:
- cluster_network == '0.0.0.0/0'
- osd_group_name in group_names
- name: make sure public_network configured
fail:
msg: "public_network must be configured. Ceph public network"
when:
- public_network == '0.0.0.0/0'
- osd_group_name in group_names
- name: make sure an osd scenario was chosen
fail:
msg: "please choose an osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- not journal_collocation
- not raw_multi_journal
- not osd_directory
- not bluestore
- not dmcrypt_journal_collocation
- not dmcrypt_dedicated_journal
- name: verify only one osd scenario was chosen
fail:
msg: "please select only one osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- (journal_collocation and raw_multi_journal)
or (journal_collocation and osd_directory)
or (journal_collocation and bluestore)
or (raw_multi_journal and osd_directory)
or (raw_multi_journal and bluestore)
or (osd_directory and bluestore)
or (dmcrypt_journal_collocation and journal_collocation)
or (dmcrypt_journal_collocation and raw_multi_journal)
or (dmcrypt_journal_collocation and osd_directory)
or (dmcrypt_journal_collocation and bluestore)
or (dmcrypt_dedicated_journal and journal_collocation)
or (dmcrypt_dedicated_journal and raw_multi_journal)
or (dmcrypt_dedicated_journal and osd_directory)
or (dmcrypt_dedicated_journal and bluestore)
or (dmcrypt_dedicated_journal and dmcrypt_journal_collocation)
- name: verify devices have been provided
fail:
msg: "please provide devices to your osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- journal_collocation
- not osd_auto_discovery
- devices is not defined
- name: verify journal devices have been provided
fail:
msg: "please provide devices to your osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- raw_multi_journal
- raw_journal_devices is not defined
or devices is not defined
- name: verify directories have been provided
fail:
msg: "please provide directories to your osd scenario"
when:
- osd_group_name is defined
- osd_group_name in group_names
- osd_directory
- osd_directories is not defined