2018-04-26 03:57:27 +08:00
|
|
|
---
|
2019-12-07 05:11:51 +08:00
|
|
|
- name: include check_system.yml
|
|
|
|
include_tasks: check_system.yml
|
|
|
|
|
2019-11-07 20:00:21 +08:00
|
|
|
- name: validate repository variables in non-containerized scenario
|
|
|
|
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']
|
2019-10-11 23:42:36 +08:00
|
|
|
|
2019-11-07 20:00:21 +08:00
|
|
|
- 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']
|
2019-10-11 23:42:36 +08:00
|
|
|
|
2019-11-07 20:00:21 +08:00
|
|
|
- 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']
|
2019-10-11 23:42:36 +08:00
|
|
|
|
2019-11-07 20:00:21 +08:00
|
|
|
- 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']
|
2019-10-11 23:42:36 +08:00
|
|
|
|
|
|
|
- name: validate osd_objectstore
|
|
|
|
fail:
|
|
|
|
msg: "osd_objectstore must be either 'bluestore' or 'filestore'"
|
|
|
|
when: osd_objectstore not in ['bluestore', 'filestore']
|
|
|
|
|
|
|
|
- name: validate monitor network configuration
|
|
|
|
fail:
|
|
|
|
msg: "Either monitor_address, monitor_address_block or monitor_interface must be provided"
|
|
|
|
when:
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- monitor_address == '0.0.0.0'
|
|
|
|
- monitor_address_block == 'subnet'
|
|
|
|
- monitor_interface == 'interface'
|
|
|
|
|
|
|
|
- name: validate radosgw network configuration
|
|
|
|
fail:
|
|
|
|
msg: "Either radosgw_address, radosgw_address_block or radosgw_interface must be provided"
|
|
|
|
when:
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- radosgw_address == '0.0.0.0'
|
|
|
|
- radosgw_address_block == 'subnet'
|
|
|
|
- radosgw_interface == 'interface'
|
|
|
|
|
|
|
|
- name: validate osd nodes
|
|
|
|
when: osd_group_name in group_names
|
|
|
|
block:
|
|
|
|
- name: validate lvm osd scenario
|
|
|
|
fail:
|
|
|
|
msg: 'devices or lvm_volumes must be defined for lvm osd scenario'
|
|
|
|
when:
|
|
|
|
- not osd_auto_discovery | default(false) | bool
|
|
|
|
- devices is undefined
|
|
|
|
- lvm_volumes is undefined
|
|
|
|
|
|
|
|
- name: validate filestore lvm osd scenario
|
|
|
|
fail:
|
|
|
|
msg: 'data and journal keys must be defined in lvm_volumes'
|
|
|
|
when:
|
|
|
|
- osd_objectstore == 'filestore'
|
|
|
|
- not osd_auto_discovery | default(false) | bool
|
|
|
|
- lvm_volumes is defined
|
|
|
|
- lvm_volumes | length > 0
|
|
|
|
- item.data is undefined or item.journal is undefined
|
|
|
|
with_items: '{{ lvm_volumes }}'
|
|
|
|
|
|
|
|
- name: validate bluestore lvm osd scenario
|
|
|
|
fail:
|
|
|
|
msg: 'data key must be defined in lvm_volumes'
|
|
|
|
when:
|
|
|
|
- osd_objectstore == 'bluestore'
|
|
|
|
- not osd_auto_discovery | default(false) | bool
|
|
|
|
- lvm_volumes is defined
|
|
|
|
- lvm_volumes | length > 0
|
|
|
|
- item.data is undefined
|
|
|
|
with_items: '{{ lvm_volumes }}'
|
2018-04-26 03:59:54 +08:00
|
|
|
|
2018-08-09 17:23:07 +08:00
|
|
|
- name: warning deprecation for fqdn configuration
|
|
|
|
fail:
|
|
|
|
msg: "fqdn configuration is not supported anymore. Use 'use_fqdn_yes_i_am_sure: true' if you really want to use it. See release notes for more details"
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- mon_use_fqdn | bool or mds_use_fqdn | bool
|
|
|
|
- not use_fqdn_yes_i_am_sure | bool
|
2018-08-09 17:23:07 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: debian based systems tasks
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_os_family == 'Debian'
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: fail if local scenario is enabled on debian
|
|
|
|
fail:
|
|
|
|
msg: "'local' installation scenario not supported on Debian systems"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ceph_origin == 'local'
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: verify that ceph_rhcs_cdn_debian_repo url is valid for red hat storage
|
|
|
|
fail:
|
|
|
|
msg: "ceph_rhcs_cdn_debian_repo url is invalid, please set your customername:customerpasswd"
|
|
|
|
when:
|
|
|
|
- ceph_origin == 'repository'
|
|
|
|
- ceph_repository == 'rhcs'
|
|
|
|
- ceph_repository_type == 'cdn'
|
|
|
|
- ceph_rhcs_cdn_debian_repo == 'https://customername:customerpasswd@rhcs.download.redhat.com'
|
|
|
|
- ceph_repository not in ['rhcs', 'dev', 'obs']
|
2018-04-27 00:15:02 +08:00
|
|
|
|
2019-08-22 02:56:36 +08:00
|
|
|
# SUSE/openSUSE Leap only supports the following:
|
|
|
|
# - ceph_origin == 'distro'
|
|
|
|
# - ceph_origin == 'repository' and ceph_repository == 'obs'
|
|
|
|
- name: SUSE/openSUSE Leap based system tasks
|
|
|
|
when: ansible_os_family == 'Suse'
|
|
|
|
block:
|
|
|
|
- name: Check ceph_origin definition on SUSE/openSUSE Leap
|
|
|
|
fail:
|
|
|
|
msg: "Unsupported installation method origin:{{ ceph_origin }}"
|
|
|
|
when: ceph_origin not in ['distro', 'repository']
|
|
|
|
|
|
|
|
- name: Check ceph_repository definition on SUSE/openSUSE Leap
|
|
|
|
fail:
|
|
|
|
msg: "Unsupported installation method origin:{{ ceph_origin }} repo:{{ ceph_repository }}'
|
|
|
|
only valid combination is ceph_origin == 'repository' and ceph_repository == 'obs'"
|
|
|
|
when:
|
|
|
|
- ceph_origin == 'repository'
|
|
|
|
- ceph_repository != 'obs'
|
|
|
|
|
2018-09-06 00:59:50 +08:00
|
|
|
- name: validate ntp daemon type
|
|
|
|
fail:
|
|
|
|
msg: "ntp_daemon_type must be one of chronyd, ntpd, or timesyncd"
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- ntp_service_enabled | bool
|
2018-09-06 00:59:50 +08:00
|
|
|
- ntp_daemon_type not in ['chronyd', 'ntpd', 'timesyncd']
|
|
|
|
|
2019-02-05 17:26:03 +08:00
|
|
|
# Since NTPd can not be installed on Atomic...
|
2019-02-12 14:55:13 +08:00
|
|
|
- name: abort if ntp_daemon_type is ntpd on Atomic
|
2019-02-05 17:26:03 +08:00
|
|
|
fail:
|
|
|
|
msg: installation can't happen on Atomic and ntpd needs to be installed
|
|
|
|
when:
|
2019-05-22 16:02:42 +08:00
|
|
|
- is_atomic | default(False) | bool
|
2019-02-05 17:26:03 +08:00
|
|
|
- ansible_os_family == 'RedHat'
|
|
|
|
- ntp_daemon_type == 'ntpd'
|
|
|
|
|
2018-04-26 23:09:47 +08:00
|
|
|
- name: make sure journal_size configured
|
|
|
|
debug:
|
|
|
|
msg: "WARNING: journal_size is configured to {{ journal_size }}, which is less than 5GB. This is not recommended and can lead to severe issues."
|
|
|
|
when:
|
|
|
|
- journal_size|int < 5120
|
|
|
|
- osd_objectstore == 'filestore'
|
|
|
|
- osd_group_name in group_names
|
|
|
|
|
2018-07-18 21:59:22 +08:00
|
|
|
- name: include check_devices.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: check_devices.yml
|
2018-07-18 23:46:27 +08:00
|
|
|
when:
|
|
|
|
- osd_group_name in group_names
|
2019-05-22 16:02:42 +08:00
|
|
|
- not osd_auto_discovery | default(False) | bool
|
2018-10-13 00:32:40 +08:00
|
|
|
- devices|default([])|length > 0
|
2018-07-23 22:02:43 +08:00
|
|
|
|
|
|
|
- name: include check_eth_mon.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: check_eth_mon.yml
|
2018-07-23 22:02:43 +08:00
|
|
|
when:
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- monitor_interface != "dummy"
|
|
|
|
- monitor_address == "0.0.0.0"
|
|
|
|
- monitor_address_block == "subnet"
|
|
|
|
|
2019-03-15 04:22:01 +08:00
|
|
|
- name: include check_ipaddr_mon.yml
|
|
|
|
include_tasks: check_ipaddr_mon.yml
|
|
|
|
when:
|
|
|
|
- mon_group_name in group_names
|
|
|
|
- monitor_interface == "interface"
|
|
|
|
- monitor_address == "0.0.0.0"
|
|
|
|
- monitor_address_block != "subnet"
|
|
|
|
|
2018-07-23 22:02:43 +08:00
|
|
|
- name: include check_eth_rgw.yml
|
2018-08-21 22:23:35 +08:00
|
|
|
include_tasks: check_eth_rgw.yml
|
2018-07-23 22:02:43 +08:00
|
|
|
when:
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- radosgw_interface != "dummy"
|
|
|
|
- radosgw_address == "0.0.0.0"
|
2018-08-04 00:15:58 +08:00
|
|
|
- radosgw_address_block == "subnet"
|
2018-09-29 05:23:10 +08:00
|
|
|
|
2018-10-26 22:39:56 +08:00
|
|
|
- name: include check_rgw_multisite.yml
|
|
|
|
include_tasks: check_rgw_multisite.yml
|
2018-10-30 22:01:46 +08:00
|
|
|
when:
|
2018-10-26 22:39:56 +08:00
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
2019-05-22 16:02:42 +08:00
|
|
|
- rgw_multisite | bool
|
2018-10-26 22:39:56 +08:00
|
|
|
|
2018-09-29 05:23:10 +08:00
|
|
|
- name: include check_iscsi.yml
|
2018-10-04 16:02:24 +08:00
|
|
|
include_tasks: check_iscsi.yml
|
2019-04-01 23:46:15 +08:00
|
|
|
when: iscsi_gw_group_name in group_names
|
2019-02-26 22:16:37 +08:00
|
|
|
|
|
|
|
- name: warn about radosgw_civetweb_num_threads option deprecation
|
|
|
|
debug:
|
|
|
|
msg: "WARNING: radosgw_civetweb_num_threads variable is deprecated. Please use radosgw_thread_pool_size instead"
|
|
|
|
when:
|
|
|
|
- radosgw_frontend_type == 'civetweb'
|
|
|
|
- radosgw_civetweb_num_threads is defined
|
2019-05-20 22:28:42 +08:00
|
|
|
|
|
|
|
- name: include check_nfs.yml
|
|
|
|
include_tasks: check_nfs.yml
|
|
|
|
when: inventory_hostname in groups.get(nfs_group_name, [])
|
2019-07-29 16:03:48 +08:00
|
|
|
|
2019-11-06 00:53:22 +08:00
|
|
|
- name: include check_rbdmirror.yml
|
|
|
|
include_tasks: check_rbdmirror.yml
|
|
|
|
when:
|
|
|
|
- rbdmirror_group_name in group_names
|
|
|
|
- ceph_rbd_mirror_configure | default(false) | bool
|
|
|
|
|
2019-07-29 16:03:48 +08:00
|
|
|
- block:
|
|
|
|
- name: fail if [grafana-server] group doesn't exist
|
|
|
|
fail:
|
|
|
|
msg: "you must add a [grafana-server] group and add at least one node."
|
|
|
|
when: groups[grafana_server_group_name] is undefined
|
|
|
|
|
|
|
|
- name: fail when [grafana-server] doesn't contain at least one node.
|
|
|
|
fail:
|
|
|
|
msg: "you must add at least one node in the [grafana-server] hosts group"
|
|
|
|
when: groups[grafana_server_group_name] | length < 1
|
2019-08-22 02:56:36 +08:00
|
|
|
when: dashboard_enabled | bool
|
2019-09-11 03:33:44 +08:00
|
|
|
|
|
|
|
- name: validate container registry credentials
|
|
|
|
fail:
|
|
|
|
msg: 'ceph_docker_registry_username and/or ceph_docker_registry_password variables need to be set'
|
|
|
|
when:
|
|
|
|
- ceph_docker_registry_auth | bool
|
2019-10-21 23:09:31 +08:00
|
|
|
- (ceph_docker_registry_username is not defined or ceph_docker_registry_password is not defined) or
|
|
|
|
(ceph_docker_registry_username | length == 0 or ceph_docker_registry_password | length == 0)
|