2018-04-26 03:57:27 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include check_system.yml
|
|
|
|
ansible.builtin.include_tasks: check_system.yml
|
2019-12-07 05:11:51 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate repository variables in non-containerized scenario
|
|
|
|
ansible.builtin.include_tasks: check_repository.yml
|
2019-11-07 20:00:21 +08:00
|
|
|
when: not containerized_deployment | bool
|
2019-10-11 23:42:36 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate osd_objectstore
|
|
|
|
ansible.builtin.fail:
|
2023-01-21 02:14:35 +08:00
|
|
|
msg: "osd_objectstore must be 'bluestore''"
|
2023-02-15 11:35:01 +08:00
|
|
|
when: osd_objectstore not in ['bluestore']
|
2019-10-11 23:42:36 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate radosgw network configuration
|
|
|
|
ansible.builtin.fail:
|
2019-10-11 23:42:36 +08:00
|
|
|
msg: "Either radosgw_address, radosgw_address_block or radosgw_interface must be provided"
|
|
|
|
when:
|
|
|
|
- rgw_group_name in group_names
|
2019-12-10 01:23:15 +08:00
|
|
|
- radosgw_address == 'x.x.x.x'
|
2019-10-11 23:42:36 +08:00
|
|
|
- radosgw_address_block == 'subnet'
|
|
|
|
- radosgw_interface == 'interface'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate osd nodes
|
2019-10-11 23:42:36 +08:00
|
|
|
when: osd_group_name in group_names
|
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate lvm osd scenario
|
|
|
|
ansible.builtin.fail:
|
2019-10-11 23:42:36 +08:00
|
|
|
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
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate bluestore lvm osd scenario
|
|
|
|
ansible.builtin.fail:
|
2019-10-11 23:42:36 +08:00
|
|
|
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
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Debian based systems tasks
|
2021-03-03 22:43:50 +08:00
|
|
|
when: ansible_facts['os_family'] == 'Debian'
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Fail if local scenario is enabled on debian
|
|
|
|
ansible.builtin.fail:
|
2018-09-07 20:45:43 +08:00
|
|
|
msg: "'local' installation scenario not supported on Debian systems"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ceph_origin == 'local'
|
2020-03-27 05:39:09 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Fail if rhcs repository is enabled on debian
|
|
|
|
ansible.builtin.fail:
|
2020-03-27 05:39:09 +08:00
|
|
|
msg: "RHCS isn't supported anymore on Debian distribution"
|
2018-09-07 20:45:43 +08:00
|
|
|
when:
|
|
|
|
- ceph_origin == 'repository'
|
|
|
|
- ceph_repository == 'rhcs'
|
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
|
2021-03-03 22:43:50 +08:00
|
|
|
when: ansible_facts['os_family'] == 'Suse'
|
2019-08-22 02:56:36 +08:00
|
|
|
block:
|
|
|
|
- name: Check ceph_origin definition on SUSE/openSUSE Leap
|
2024-02-14 18:14:02 +08:00
|
|
|
ansible.builtin.fail:
|
2019-08-22 02:56:36 +08:00
|
|
|
msg: "Unsupported installation method origin:{{ ceph_origin }}"
|
|
|
|
when: ceph_origin not in ['distro', 'repository']
|
|
|
|
|
|
|
|
- name: Check ceph_repository definition on SUSE/openSUSE Leap
|
2024-02-14 18:14:02 +08:00
|
|
|
ansible.builtin.fail:
|
2019-08-22 02:56:36 +08:00
|
|
|
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'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate ntp daemon type
|
|
|
|
ansible.builtin.fail:
|
2018-09-06 00:59:50 +08:00
|
|
|
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...
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Abort if ntp_daemon_type is ntpd on Atomic
|
|
|
|
ansible.builtin.fail:
|
2019-02-05 17:26:03 +08:00
|
|
|
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
|
2021-03-03 22:43:50 +08:00
|
|
|
- ansible_facts['os_family'] == 'RedHat'
|
2019-02-05 17:26:03 +08:00
|
|
|
- ntp_daemon_type == 'ntpd'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include check_devices.yml
|
|
|
|
ansible.builtin.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-07-23 22:02:43 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include check_eth_rgw.yml
|
|
|
|
ansible.builtin.include_tasks: check_eth_rgw.yml
|
2018-07-23 22:02:43 +08:00
|
|
|
when:
|
|
|
|
- rgw_group_name in group_names
|
|
|
|
- radosgw_interface != "dummy"
|
2019-12-10 01:23:15 +08:00
|
|
|
- radosgw_address == "x.x.x.x"
|
2018-08-04 00:15:58 +08:00
|
|
|
- radosgw_address_block == "subnet"
|
2018-09-29 05:23:10 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include check_rgw_pools.yml
|
|
|
|
ansible.builtin.include_tasks: check_rgw_pools.yml
|
2019-09-11 06:01:48 +08:00
|
|
|
when:
|
|
|
|
- inventory_hostname in groups.get(rgw_group_name, [])
|
|
|
|
- rgw_create_pools is defined
|
|
|
|
|
2024-06-17 22:35:10 +08:00
|
|
|
- name: Include check_nfs.yml
|
|
|
|
ansible.builtin.include_tasks: check_nfs.yml
|
|
|
|
when: inventory_hostname in groups.get(nfs_group_name, [])
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include check_rbdmirror.yml
|
|
|
|
ansible.builtin.include_tasks: check_rbdmirror.yml
|
2019-11-06 00:53:22 +08:00
|
|
|
when:
|
|
|
|
- rbdmirror_group_name in group_names
|
|
|
|
- ceph_rbd_mirror_configure | default(false) | bool
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Monitoring related tasks
|
|
|
|
when: dashboard_enabled | bool
|
|
|
|
block:
|
|
|
|
- name: Fail if monitoring group doesn't exist
|
|
|
|
ansible.builtin.fail:
|
2020-07-25 06:05:41 +08:00
|
|
|
msg: "you must add a monitoring group and add at least one node."
|
|
|
|
when: groups[monitoring_group_name] is undefined
|
2019-07-29 16:03:48 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Fail when monitoring doesn't contain at least one node.
|
|
|
|
ansible.builtin.fail:
|
2020-07-25 06:05:41 +08:00
|
|
|
msg: "you must add at least one node in the monitoring hosts group"
|
|
|
|
when: groups[monitoring_group_name] | length < 1
|
2020-01-28 20:55:54 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Fail when dashboard_admin_password and/or grafana_admin_password are not set
|
|
|
|
ansible.builtin.fail:
|
2020-01-28 20:55:54 +08:00
|
|
|
msg: "you must set dashboard_admin_password and grafana_admin_password."
|
|
|
|
when:
|
|
|
|
- dashboard_admin_password is undefined
|
|
|
|
or grafana_admin_password is undefined
|
2019-09-11 03:33:44 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate container registry credentials
|
|
|
|
ansible.builtin.fail:
|
2019-09-11 03:33:44 +08:00
|
|
|
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
|
2021-11-10 21:32:26 +08:00
|
|
|
(ceph_docker_registry_username | string | length == 0 or ceph_docker_registry_password | string | length == 0)
|
2020-02-28 22:42:44 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate container service and container package
|
|
|
|
ansible.builtin.fail:
|
2021-08-05 19:03:55 +08:00
|
|
|
msg: 'both container_package_name and container_service_name should be defined'
|
|
|
|
when:
|
|
|
|
- (container_package_name is undefined and container_service_name is defined) or
|
|
|
|
(container_package_name is defined and container_service_name is undefined)
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate openstack_keys key format
|
|
|
|
ansible.builtin.fail:
|
2020-02-28 22:42:44 +08:00
|
|
|
msg: '{{ item.name }} key format invalid'
|
|
|
|
with_items: '{{ openstack_keys }}'
|
|
|
|
when:
|
|
|
|
- osd_group_name in group_names
|
|
|
|
- openstack_keys is defined
|
|
|
|
- openstack_keys | length > 0
|
|
|
|
- item.key is defined
|
|
|
|
- item.key is not match("^[a-zA-Z0-9+/]{38}==$")
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate clients keys key format
|
|
|
|
ansible.builtin.fail:
|
2020-02-28 22:42:44 +08:00
|
|
|
msg: '{{ item.name }} key format invalid'
|
|
|
|
with_items: '{{ keys }}'
|
|
|
|
when:
|
|
|
|
- client_group_name in group_names
|
|
|
|
- keys is defined
|
|
|
|
- keys | length > 0
|
|
|
|
- item.key is defined
|
|
|
|
- item.key is not match("^[a-zA-Z0-9+/]{38}==$")
|
2020-10-05 23:16:44 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate openstack_keys caps
|
|
|
|
ansible.builtin.fail:
|
2020-10-05 23:16:44 +08:00
|
|
|
msg: '{{ item.name }} key has no caps defined'
|
|
|
|
with_items: '{{ openstack_keys }}'
|
|
|
|
when:
|
|
|
|
- osd_group_name in group_names
|
|
|
|
- openstack_keys is defined
|
|
|
|
- openstack_keys | length > 0
|
|
|
|
- item.caps is not defined
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate clients keys caps
|
|
|
|
ansible.builtin.fail:
|
2020-10-05 23:16:44 +08:00
|
|
|
msg: '{{ item.name }} key has no caps defined'
|
|
|
|
with_items: '{{ keys }}'
|
|
|
|
when:
|
|
|
|
- client_group_name in group_names
|
|
|
|
- keys is defined
|
|
|
|
- keys | length > 0
|
|
|
|
- item.caps is not defined
|
2021-01-11 17:06:08 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Check virtual_ips is defined
|
|
|
|
ansible.builtin.fail:
|
2021-01-11 17:06:08 +08:00
|
|
|
msg: "virtual_ips is not defined."
|
|
|
|
when:
|
|
|
|
- rgwloadbalancer_group_name in group_names
|
|
|
|
- groups[rgwloadbalancer_group_name] | length > 0
|
|
|
|
- virtual_ips is not defined
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Validate virtual_ips length
|
|
|
|
ansible.builtin.fail:
|
2021-01-11 17:06:08 +08:00
|
|
|
msg: "There are more virual_ips defined than rgwloadbalancer nodes"
|
|
|
|
when:
|
|
|
|
- rgwloadbalancer_group_name in group_names
|
|
|
|
- (virtual_ips | length) > (groups[rgwloadbalancer_group_name] | length)
|