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 }}"
|
2016-01-08 21:54:00 +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 }}"
|
2016-07-19 23:17:16 +08:00
|
|
|
when: "'{{ ansible_architecture }}' not in ['x86_64', 'ppc64le', 'armv7l']"
|
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 }}"
|
2016-04-23 03:13:36 +08:00
|
|
|
when: "'{{ ansible_os_family }}' not in ['Debian', 'RedHat', 'ClearLinux']"
|
2015-07-01 21:58:38 +08:00
|
|
|
|
2017-03-04 00:56:30 +08:00
|
|
|
- name: fail on unsupported distribution for red hat ceph storage
|
2015-09-04 00:18:53 +08:00
|
|
|
fail:
|
2017-05-19 16:37:31 +08:00
|
|
|
msg: "Distribution not supported {{ ansible_distribution_version }} by Red Hat Ceph Storage, only RHEL >= 7.3"
|
2015-07-01 21:58:38 +08:00
|
|
|
when:
|
2017-08-03 21:30:25 +08:00
|
|
|
- ansible_distribution == 'Red Hat Enterprise Linux'
|
|
|
|
- ceph_repository == 'rhcs'
|
2017-03-04 00:56:30 +08:00
|
|
|
- ansible_distribution_version | version_compare('7.3', '<')
|
2015-11-20 22:17:24 +08:00
|
|
|
|
2017-08-03 21:30:25 +08:00
|
|
|
- name: determine if node is registered with subscription-manager
|
|
|
|
command: subscription-manager identity
|
|
|
|
register: subscription
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
always_run: true
|
|
|
|
when:
|
|
|
|
- ansible_distribution == 'Red Hat Enterprise Linux'
|
|
|
|
- ceph_repository == 'rhcs'
|
|
|
|
- ceph_repository_type == 'cdn'
|
|
|
|
|
|
|
|
- name: fail on unregistered red hat rhcs linux
|
|
|
|
fail:
|
|
|
|
msg: "You must register your machine with subscription-manager"
|
|
|
|
when:
|
|
|
|
- ansible_distribution == 'Red Hat Enterprise Linux'
|
|
|
|
- ceph_repository == 'rhcs'
|
|
|
|
- ceph_repository_type == 'cdn'
|
|
|
|
- subscription.rc != '0'
|
|
|
|
|
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
|
|
|
|
2015-11-20 22:17:24 +08:00
|
|
|
- name: fail on unsupported ansible version
|
|
|
|
fail:
|
|
|
|
msg: "Ansible version must be >= 1.9, please update!"
|
2016-02-12 00:34:44 +08:00
|
|
|
when:
|
2016-05-09 22:08:33 +08:00
|
|
|
- ansible_version.major|int == 1
|
|
|
|
- ansible_version.minor|int < 9
|
2017-01-20 17:14:35 +08:00
|
|
|
|
|
|
|
- name: fail if systemd is not present
|
|
|
|
fail:
|
|
|
|
msg: "Systemd must be present"
|
|
|
|
when: ansible_service_mgr != 'systemd'
|