]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Refact temporary vars in ceph-common defaults. 1131/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 Nov 2016 17:14:03 +0000 (18:14 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 30 Nov 2016 13:36:56 +0000 (14:36 +0100)
These variables were defined here to be sure that
`roles/ceph-common/tasks/checks/check_mandatory_vars.yml` has all variables defined.

roles/ceph-common/defaults/main.yml
roles/ceph-common/tasks/checks/check_mandatory_vars.yml
roles/ceph-osd/tasks/check_mandatory_vars.yml [new file with mode: 0644]
roles/ceph-osd/tasks/main.yml

index deaec7f8a6f6573d57beceea3966d1824d502781..693595b8fb88565f489f8a26f077bc5dd0bbd0c3 100644 (file)
@@ -348,25 +348,6 @@ mon_containerized_deployment_with_kv: false
 mon_containerized_deployment: false
 mon_containerized_default_ceph_conf_with_kv: false
 
-
-##################
-# Temporary Vars #
-##################
-# NOTE(SamYaple): These vars are set here to they are defined before use. They
-# should be removed after a refactor has properly seperated all the checks into
-# the appropriate roles.
-
-journal_collocation: False
-raw_multi_journal: False
-osd_directory: False
-bluestore: False
-dmcrypt_journal_collocation: False
-dmcrypt_dedicated_journal: False
-raw_journal_devices: []
-devices: []
-
-osd_auto_discovery: False
-
 # Confiure the type of NFS gatway access.  At least one must be enabled for an
 # NFS role to be useful
 #
index f8858b0cc86bcbc4049b9b1e3d7635e6a754b21a..aa3ecd93052804baa5655ca214dd5b928cf1f9cf 100644 (file)
   tags:
     - package-install
 
-- name: make sure journal_size configured
-  debug:
-    msg: "WARNING: journal_size is configured to less than 5GB. This is not recommended and can lead to severe issues."
-  when:
-    - journal_size|int < 5120
-    - osd_objectstore != 'bluestore'
-    - osd_group_name in group_names
-
 - name: make sure monitor_interface or monitor_address or monitor_address_block is configured
   fail:
     msg: "Either monitor_interface, monitor_address, or monitor_address_block must be configured. Interface for the monitor to listen on or IP address of that interface"
   when:
     - public_network == '0.0.0.0/0'
     - osd_group_name in group_names
-
-- name: make sure an osd scenario was chosen
-  fail:
-    msg: "please choose an osd scenario"
-  when:
-    - osd_group_name is defined
-    - osd_group_name in group_names
-    - not journal_collocation
-    - not raw_multi_journal
-    - not osd_directory
-    - not bluestore
-    - not dmcrypt_journal_collocation
-    - not dmcrypt_dedicated_journal
-
-- name: verify only one osd scenario was chosen
-  fail:
-    msg: "please select only one osd scenario"
-  when:
-    - osd_group_name is defined
-    - osd_group_name in group_names
-    - (journal_collocation and raw_multi_journal)
-      or (journal_collocation and osd_directory)
-      or (journal_collocation and bluestore)
-      or (raw_multi_journal and osd_directory)
-      or (raw_multi_journal and bluestore)
-      or (osd_directory and bluestore)
-      or (dmcrypt_journal_collocation and journal_collocation)
-      or (dmcrypt_journal_collocation and raw_multi_journal)
-      or (dmcrypt_journal_collocation and osd_directory)
-      or (dmcrypt_journal_collocation and bluestore)
-      or (dmcrypt_dedicated_journal and journal_collocation)
-      or (dmcrypt_dedicated_journal and raw_multi_journal)
-      or (dmcrypt_dedicated_journal and osd_directory)
-      or (dmcrypt_dedicated_journal and bluestore)
-      or (dmcrypt_dedicated_journal and dmcrypt_journal_collocation)
-
-- name: verify devices have been provided
-  fail:
-    msg: "please provide devices to your osd scenario"
-  when:
-    - osd_group_name is defined
-    - osd_group_name in group_names
-    - journal_collocation
-    - not osd_auto_discovery
-    - devices|length == 0
-
-- name: verify journal devices have been provided
-  fail:
-    msg: "please provide devices and raw journal devices to your osd scenario"
-  when:
-    - osd_group_name is defined
-    - osd_group_name in group_names
-    - raw_multi_journal
-    - raw_journal_devices|length == 0
-      or devices|length == 0
-
-- name: verify directories have been provided
-  fail:
-    msg: "please provide directories to your osd scenario"
-  when:
-    - osd_group_name is defined
-    - osd_group_name in group_names
-    - osd_directory
-    - osd_directories is not defined
diff --git a/roles/ceph-osd/tasks/check_mandatory_vars.yml b/roles/ceph-osd/tasks/check_mandatory_vars.yml
new file mode 100644 (file)
index 0000000..537c820
--- /dev/null
@@ -0,0 +1,72 @@
+---
+- name: make sure journal_size configured
+  debug:
+    msg: "WARNING: journal_size is configured to less than 5GB. This is not recommended and can lead to severe issues."
+  when:
+    - journal_size|int < 5120
+    - osd_objectstore != 'bluestore'
+    - osd_group_name in group_names
+
+- name: make sure an osd scenario was chosen
+  fail:
+    msg: "please choose an osd scenario"
+  when:
+    - osd_group_name is defined
+    - osd_group_name in group_names
+    - not journal_collocation
+    - not raw_multi_journal
+    - not osd_directory
+    - not bluestore
+    - not dmcrypt_journal_collocation
+    - not dmcrypt_dedicated_journal
+
+- name: verify only one osd scenario was chosen
+  fail:
+    msg: "please select only one osd scenario"
+  when:
+    - osd_group_name is defined
+    - osd_group_name in group_names
+    - (journal_collocation and raw_multi_journal)
+      or (journal_collocation and osd_directory)
+      or (journal_collocation and bluestore)
+      or (raw_multi_journal and osd_directory)
+      or (raw_multi_journal and bluestore)
+      or (osd_directory and bluestore)
+      or (dmcrypt_journal_collocation and journal_collocation)
+      or (dmcrypt_journal_collocation and raw_multi_journal)
+      or (dmcrypt_journal_collocation and osd_directory)
+      or (dmcrypt_journal_collocation and bluestore)
+      or (dmcrypt_dedicated_journal and journal_collocation)
+      or (dmcrypt_dedicated_journal and raw_multi_journal)
+      or (dmcrypt_dedicated_journal and osd_directory)
+      or (dmcrypt_dedicated_journal and bluestore)
+      or (dmcrypt_dedicated_journal and dmcrypt_journal_collocation)
+
+- name: verify devices have been provided
+  fail:
+    msg: "please provide devices to your osd scenario"
+  when:
+    - osd_group_name is defined
+    - osd_group_name in group_names
+    - journal_collocation
+    - not osd_auto_discovery
+    - devices|length == 0
+
+- name: verify journal devices have been provided
+  fail:
+    msg: "please provide devices and raw journal devices to your osd scenario"
+  when:
+    - osd_group_name is defined
+    - osd_group_name in group_names
+    - raw_multi_journal
+    - raw_journal_devices|length == 0
+      or devices|length == 0
+
+- name: verify directories have been provided
+  fail:
+    msg: "please provide directories to your osd scenario"
+  when:
+    - osd_group_name is defined
+    - osd_group_name in group_names
+    - osd_directory
+    - osd_directories is not defined
index 94a9d5810cb328c7771823123f151d4195d01aac..d4f320961350dd6f15f96feb31e1e1583c655c34 100644 (file)
@@ -1,4 +1,6 @@
 ---
+- include: check_mandatory_vars.yml
+
 - include: pre_requisite.yml
   when: not osd_containerized_deployment
   # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)