2015-01-07 18:41:35 +08:00
|
|
|
---
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: fail on unsupported system
|
2015-09-04 00:18:53 +08:00
|
|
|
fail:
|
|
|
|
msg: "System not supported {{ ansible_system }}"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_system not in ['Linux']
|
2015-01-07 18:41:35 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: fail on unsupported architecture
|
2015-09-04 00:18:53 +08:00
|
|
|
fail:
|
|
|
|
msg: "Architecture not supported {{ ansible_architecture }}"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_architecture not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
|
2015-01-07 18:41:35 +08:00
|
|
|
|
2015-05-16 00:27:41 +08:00
|
|
|
- name: fail on unsupported distribution
|
2015-09-04 00:18:53 +08:00
|
|
|
fail:
|
|
|
|
msg: "Distribution not supported {{ ansible_os_family }}"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
|
2015-07-01 21:58:38 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: red hat based systems tasks
|
2019-03-28 16:13:30 +08:00
|
|
|
when:
|
|
|
|
- ceph_repository == 'rhcs'
|
|
|
|
- ansible_distribution == 'Red Hat Enterprise Linux'
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: fail on unsupported distribution for red hat ceph storage
|
|
|
|
fail:
|
|
|
|
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Ceph Storage, only RHEL >= 7.3"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_distribution_version | version_compare('7.3', '<')
|
2015-11-20 22:17:24 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: subscription manager related tasks
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ceph_repository_type == 'cdn'
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: determine if node is registered with subscription-manager
|
|
|
|
command: subscription-manager identity
|
|
|
|
register: subscription
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
check_mode: no
|
2017-08-03 21:30:25 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: fail on unregistered red hat rhcs linux
|
|
|
|
fail:
|
|
|
|
msg: "You must register your machine with subscription-manager"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: subscription.rc != '0'
|
2017-08-03 21:30:25 +08:00
|
|
|
|
2016-05-03 00:25:52 +08:00
|
|
|
- name: fail on unsupported distribution for ubuntu cloud archive
|
|
|
|
fail:
|
|
|
|
msg: "Distribution not supported by Ubuntu Cloud Archive: {{ ansible_distribution }}"
|
|
|
|
when:
|
2017-08-03 21:30:25 +08:00
|
|
|
- ceph_repository == 'uca'
|
|
|
|
- ansible_distribution != 'Ubuntu'
|
2016-05-03 00:25:52 +08:00
|
|
|
|
2017-10-12 21:55:20 +08:00
|
|
|
- name: fail on unsupported openSUSE distribution
|
|
|
|
fail:
|
|
|
|
msg: "Distribution not supported: {{ ansible_distribution }}"
|
|
|
|
when:
|
|
|
|
- ansible_distribution == 'openSUSE Leap'
|
2018-10-06 06:53:40 +08:00
|
|
|
- ansible_distribution_version is version_compare('42.3', '<')
|
2017-10-12 21:55:20 +08:00
|
|
|
|
2018-07-12 17:31:00 +08:00
|
|
|
- name: fail on unsupported ansible version (1.X)
|
2015-11-20 22:17:24 +08:00
|
|
|
fail:
|
2019-04-17 22:22:59 +08:00
|
|
|
msg: "Ansible version must be >= 2.7.x, please update!"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_version.major|int < 2
|
2017-09-06 23:52:49 +08:00
|
|
|
|
|
|
|
- name: fail on unsupported ansible version
|
|
|
|
fail:
|
2019-04-17 22:22:59 +08:00
|
|
|
msg: "Ansible version must be 2.7 or 2.8!"
|
2017-09-06 23:52:49 +08:00
|
|
|
when:
|
2019-04-17 22:22:59 +08:00
|
|
|
- ansible_version.major|int == 2
|
|
|
|
- ansible_version.minor|int not in [7, 8]
|
2017-01-20 17:14:35 +08:00
|
|
|
|
|
|
|
- name: fail if systemd is not present
|
|
|
|
fail:
|
|
|
|
msg: "Systemd must be present"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_service_mgr != 'systemd'
|
2017-08-05 02:18:11 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: check if iscsi gateways is target on supported distros and versions
|
|
|
|
block:
|
|
|
|
- name: fail on unsupported distribution for iscsi gateways
|
|
|
|
fail:
|
2018-11-08 17:02:37 +08:00
|
|
|
msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux, CentOS or Fedora"
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ansible_distribution not in ['RedHat', 'CentOS', 'Fedora']
|
2017-08-05 02:18:11 +08:00
|
|
|
|
2018-09-07 20:45:43 +08:00
|
|
|
- name: fail on unsupported distribution version for iscsi gateways
|
|
|
|
fail:
|
|
|
|
msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux or CentOS >= 7.4"
|
|
|
|
when:
|
|
|
|
- ansible_distribution_version < '7.4'
|
|
|
|
- ansible_distribution in ['RedHat', 'CentOS']
|
2019-04-01 23:46:15 +08:00
|
|
|
when: iscsi_gw_group_name in group_names
|
2018-10-01 21:27:06 +08:00
|
|
|
|