2015-01-07 18:41:35 +08:00
|
|
|
---
|
2019-12-07 05:11:51 +08:00
|
|
|
- name: fail on unsupported ansible version (1.X)
|
|
|
|
fail:
|
2019-11-01 21:28:03 +08:00
|
|
|
msg: "Ansible version must be >= 2.x, please update!"
|
2019-12-07 05:11:51 +08:00
|
|
|
when: ansible_version.major|int < 2
|
|
|
|
|
|
|
|
- name: fail on unsupported ansible version
|
|
|
|
fail:
|
2020-03-24 22:48:58 +08:00
|
|
|
msg: "Ansible version must be 2.9!"
|
|
|
|
when: ansible_version.minor|int != 9
|
2019-12-07 05:11:51 +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
|
|
|
|
2020-01-11 00:25:54 +08:00
|
|
|
- name: fail on unsupported CentOS release
|
|
|
|
fail:
|
|
|
|
msg: "CentOS release not supported {{ ansible_distribution_major_version }}"
|
|
|
|
when:
|
|
|
|
- ansible_distribution == 'CentOS'
|
|
|
|
- ansible_distribution_major_version | int != 8
|
|
|
|
|
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'
|
2020-04-10 02:00:52 +08:00
|
|
|
- ansible_distribution == 'RedHat'
|
2018-09-07 20:45:43 +08:00
|
|
|
block:
|
|
|
|
- name: fail on unsupported distribution for red hat ceph storage
|
|
|
|
fail:
|
2020-04-10 02:00:52 +08:00
|
|
|
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Ceph Storage, only RHEL >= 8.2"
|
2020-04-18 00:34:32 +08:00
|
|
|
when: ansible_distribution_version is version('8.2', '<')
|
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"
|
2020-04-21 21:14:46 +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
|
|
|
|
2019-08-22 03:36:38 +08:00
|
|
|
- name: "fail on unsupported SUSE/openSUSE distribution (only 15.x supported)"
|
2017-10-12 21:55:20 +08:00
|
|
|
fail:
|
2019-08-22 03:36:38 +08:00
|
|
|
msg: "Distribution not supported: {{ ansible_distribution }} {{ ansible_distribution_major_version }}"
|
2017-10-12 21:55:20 +08:00
|
|
|
when:
|
2019-08-22 03:36:38 +08:00
|
|
|
- ansible_distribution == 'openSUSE Leap' or ansible_distribution == 'SUSE'
|
2019-07-27 22:09:26 +08:00
|
|
|
- ansible_distribution_major_version != '15'
|
2017-10-12 21:55:20 +08:00
|
|
|
|
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'
|