]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-validate: move system checks from ceph-common to ceph-validate
authorAndrew Schoen <aschoen@redhat.com>
Thu, 17 May 2018 18:47:27 +0000 (13:47 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Fri, 18 May 2018 15:58:24 +0000 (17:58 +0200)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
roles/ceph-common/tasks/checks/check_system.yml [deleted file]
roles/ceph-common/tasks/main.yml
roles/ceph-validate/tasks/check_system.yml [new file with mode: 0644]
roles/ceph-validate/tasks/main.yml

diff --git a/roles/ceph-common/tasks/checks/check_system.yml b/roles/ceph-common/tasks/checks/check_system.yml
deleted file mode 100644 (file)
index dc39509..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
----
-- name: fail on unsupported system
-  fail:
-    msg: "System not supported {{ ansible_system }}"
-  when:
-    - ansible_system not in ['Linux']
-
-- name: fail on unsupported architecture
-  fail:
-    msg: "Architecture not supported {{ ansible_architecture }}"
-  when:
-    - ansible_architecture not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
-
-- name: fail on unsupported distribution
-  fail:
-    msg: "Distribution not supported {{ ansible_os_family }}"
-  when:
-    - ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
-
-- 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"
-  when:
-    - ansible_distribution == 'Red Hat Enterprise Linux'
-    - ceph_repository == 'rhcs'
-    - ansible_distribution_version | version_compare('7.3', '<')
-
-- name: determine if node is registered with subscription-manager
-  command: subscription-manager identity
-  register: subscription
-  changed_when: false
-  failed_when: false
-  check_mode: no
-  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'
-
-- name: fail on unsupported distribution for ubuntu cloud archive
-  fail:
-    msg: "Distribution not supported by Ubuntu Cloud Archive: {{ ansible_distribution }}"
-  when:
-    - ceph_repository == 'uca'
-    - ansible_distribution != 'Ubuntu'
-
-- name: fail on unsupported openSUSE distribution
-  fail:
-    msg: "Distribution not supported: {{ ansible_distribution }}"
-  when:
-    - ansible_distribution == 'openSUSE Leap'
-    - ansible_distribution_version | version_compare('42.3', '<')
-
-- name: fail on unsupported ansible version
-  fail:
-    msg: "Ansible version must be >= 2.3.x, please update!"
-  when:
-    - ansible_version.major|int < 2
-
-- name: fail on unsupported ansible version
-  fail:
-    msg: "Ansible version must be >= 2.3.x, please update!"
-  when:
-    - ansible_version.major|int == 2
-    - ansible_version.minor|int < 3
-
-- name: fail if systemd is not present
-  fail:
-    msg: "Systemd must be present"
-  when:
-    - ansible_service_mgr != 'systemd'
-
-- name: fail on unsupported distribution for iscsi gateways
-  fail:
-    msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux or CentOS"
-  when:
-    - ansible_distribution not in ['RedHat', 'CentOS']
-    - iscsi_gw_group_name in group_names
-
-- 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 in ['RedHat', 'CentOS']
-    - ansible_distribution_version < '7.4'
-    - iscsi_gw_group_name in group_names
index 96568566c048e88f44519f25f2d990189e88b882..092cac39874796d8817bbf474507a5fc1045cc60 100644 (file)
@@ -1,7 +1,4 @@
 ---
-- name: include checks/check_system.yml
-  include: checks/check_system.yml
-
 - name: include checks/check_firewall.yml
   include: checks/check_firewall.yml
   when:
diff --git a/roles/ceph-validate/tasks/check_system.yml b/roles/ceph-validate/tasks/check_system.yml
new file mode 100644 (file)
index 0000000..dc39509
--- /dev/null
@@ -0,0 +1,94 @@
+---
+- name: fail on unsupported system
+  fail:
+    msg: "System not supported {{ ansible_system }}"
+  when:
+    - ansible_system not in ['Linux']
+
+- name: fail on unsupported architecture
+  fail:
+    msg: "Architecture not supported {{ ansible_architecture }}"
+  when:
+    - ansible_architecture not in ['x86_64', 'ppc64le', 'armv7l', 'aarch64']
+
+- name: fail on unsupported distribution
+  fail:
+    msg: "Distribution not supported {{ ansible_os_family }}"
+  when:
+    - ansible_os_family not in ['Debian', 'RedHat', 'ClearLinux', 'Suse']
+
+- 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"
+  when:
+    - ansible_distribution == 'Red Hat Enterprise Linux'
+    - ceph_repository == 'rhcs'
+    - ansible_distribution_version | version_compare('7.3', '<')
+
+- name: determine if node is registered with subscription-manager
+  command: subscription-manager identity
+  register: subscription
+  changed_when: false
+  failed_when: false
+  check_mode: no
+  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'
+
+- name: fail on unsupported distribution for ubuntu cloud archive
+  fail:
+    msg: "Distribution not supported by Ubuntu Cloud Archive: {{ ansible_distribution }}"
+  when:
+    - ceph_repository == 'uca'
+    - ansible_distribution != 'Ubuntu'
+
+- name: fail on unsupported openSUSE distribution
+  fail:
+    msg: "Distribution not supported: {{ ansible_distribution }}"
+  when:
+    - ansible_distribution == 'openSUSE Leap'
+    - ansible_distribution_version | version_compare('42.3', '<')
+
+- name: fail on unsupported ansible version
+  fail:
+    msg: "Ansible version must be >= 2.3.x, please update!"
+  when:
+    - ansible_version.major|int < 2
+
+- name: fail on unsupported ansible version
+  fail:
+    msg: "Ansible version must be >= 2.3.x, please update!"
+  when:
+    - ansible_version.major|int == 2
+    - ansible_version.minor|int < 3
+
+- name: fail if systemd is not present
+  fail:
+    msg: "Systemd must be present"
+  when:
+    - ansible_service_mgr != 'systemd'
+
+- name: fail on unsupported distribution for iscsi gateways
+  fail:
+    msg: "iSCSI gateways can only be deployed on Red Hat Enterprise Linux or CentOS"
+  when:
+    - ansible_distribution not in ['RedHat', 'CentOS']
+    - iscsi_gw_group_name in group_names
+
+- 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 in ['RedHat', 'CentOS']
+    - ansible_distribution_version < '7.4'
+    - iscsi_gw_group_name in group_names
index 98174882e708b9b48f02e6e4dcb910762a127fc4..f7d5cf537009d83f3082ece3d8ef1bfb1dba195d 100644 (file)
@@ -56,3 +56,6 @@
     - osd_group_name in group_names
     - osd_objectstore == 'bluestore'
     - ceph_release_num[ceph_release] < ceph_release_num.luminous
+
+- name: include check_system.yml
+  include: check_system.yml