]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
tests: remove OSD_FORCE_ZAP variable from tests 2170/head
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 14 Nov 2017 10:58:38 +0000 (11:58 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 14 Nov 2017 16:55:01 +0000 (17:55 +0100)
according to ceph/ceph-container#840, this variable is no longer needed.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-osd/tasks/build_devices.yml [new file with mode: 0644]
roles/ceph-osd/tasks/check_devices.yml [deleted file]
roles/ceph-osd/tasks/check_devices_static.yml [deleted file]
roles/ceph-osd/tasks/main.yml
tests/functional/centos/7/bs-osds-container/group_vars/all.yml
tests/functional/centos/7/docker-collocation/group_vars/all
tests/functional/centos/7/docker/group_vars/all
tests/functional/centos/7/fs-osds-container/group_vars/all.yml

diff --git a/roles/ceph-osd/tasks/build_devices.yml b/roles/ceph-osd/tasks/build_devices.yml
new file mode 100644 (file)
index 0000000..b578c32
--- /dev/null
@@ -0,0 +1,37 @@
+---
+- name: set_fact devices generate device list when osd_auto_discovery
+  set_fact:
+    devices: "{{ devices | default([]) + [ item.key | regex_replace('^', '/dev/') ] }}"
+  with_dict: "{{ ansible_devices }}"
+  when:
+    - osd_auto_discovery
+    - ansible_devices is defined
+    - item.value.removable == "0"
+    - item.value.sectors != "0"
+    - item.value.partitions|count == 0
+    - item.value.holders|count == 0
+    - "'dm-' not in item.key"
+
+- name: resolve dedicated device link(s)
+  command: readlink -f {{ item }}
+  changed_when: false
+  with_items: "{{ dedicated_devices }}"
+  register: dedicated_devices_prepare_canonicalize
+  when:
+    - osd_scenario == 'non-collocated'
+    - not osd_auto_discovery
+
+- name: set_fact build dedicated_devices from resolved symlinks
+  set_fact:
+    dedicated_devices_tmp: "{{ dedicated_devices_tmp | default([]) + [ item.stdout ] }}"
+  with_items: "{{ dedicated_devices_prepare_canonicalize.results }}"
+  when:
+    - osd_scenario == 'non-collocated'
+    - not osd_auto_discovery
+
+- name: set_fact build final dedicated_devices list
+  set_fact:
+    dedicated_devices: "{{ dedicated_devices_tmp | reject('search','/dev/disk') | list }}"
+  when:
+    - osd_scenario == 'non-collocated'
+    - not osd_auto_discovery
diff --git a/roles/ceph-osd/tasks/check_devices.yml b/roles/ceph-osd/tasks/check_devices.yml
deleted file mode 100644 (file)
index 629661d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
----
-# NOTE (leseb): current behavior of ceph-disk is to fail when the device is mounted "stderr: ceph-disk: Error: Device is mounted: /dev/sdb1"
-# the return code is 1, which makes sense, however ideally if ceph-disk will detect a ceph partition
-# it should exist we rc=0 and don't do anything unless we do something like --force
-# As as a final word, I prefer to keep the partition check instead of running ceph-disk prepare with "failed_when: false"
-# I believe it's safer
-#
-# regex syntax uses (pat1|pat2|...|patN) for different families of device
-# names, but has a common expression for partition number at the end.
-# allow 2-digit partition numbers so fast SSDs can be shared by > 9 disks
-# for SSD journals.
-
-- name: resolve dedicated device link(s)
-  command: readlink -f {{ item }}
-  changed_when: false
-  with_items: "{{ dedicated_devices }}"
-  register: dedicated_devices_prepare_canonicalize
-  when:
-    - osd_scenario == 'non-collocated'
-
-- name: set_fact build dedicated_devices from resolved symlinks
-  set_fact:
-    dedicated_devices_tmp: "{{ dedicated_devices_tmp | default([]) + [ item.stdout ] }}"
-  with_items: "{{ dedicated_devices_prepare_canonicalize.results }}"
-  when:
-    - osd_scenario == 'non-collocated'
-
-- name: set_fact build final dedicated_devices list
-  set_fact:
-    dedicated_devices: "{{ dedicated_devices_tmp | reject('search','/dev/disk') | list }}"
-  when:
-    - osd_scenario == 'non-collocated'
-
-- name: include check_devices_static.yml
-  include: check_devices_static.yml
-  # Hard code this so we will skip the entire file instead of individual tasks (Default isn't Consistent)
-  static: False
-
-- name: check the partition status of the journal devices
-  command: "parted --script {{ item }} print"
-  with_items:
-    - "{{ dedicated_devices|unique }}"
-  changed_when: false
-  failed_when: false
-  check_mode: no
-  register: journal_partition_status
-  when:
-    - osd_scenario == 'non-collocated'
-
-- name: fix partitions gpt header or labels of the journal device(s)
-  shell: "sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }}"
-  with_together:
-    - "{{ journal_partition_status.results }}"
-    - "{{ dedicated_devices|unique }}"
-  changed_when: false
-  when:
-    - not containerized_deployment
-    - osd_scenario == 'non-collocated'
-    - not item.0.get("skipped")
-    - item.0.get("rc", 0) != 0
-
-- name: create gpt disk label of the journal device(s)
-  command: parted --script {{ item.1 }} mklabel gpt
-  with_together:
-    - "{{ journal_partition_status.results }}"
-    - "{{ dedicated_devices|unique }}"
-  changed_when: false
-  when:
-    - containerized_deployment
-    - osd_scenario == 'non-collocated'
-    - not item.0.get("skipped")
-    - item.0.get("rc", 0) != 0
diff --git a/roles/ceph-osd/tasks/check_devices_static.yml b/roles/ceph-osd/tasks/check_devices_static.yml
deleted file mode 100644 (file)
index 9b63377..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
----
-- name: check the partition status of the osd disks
-  command: "parted --script {{ item }} print"
-  with_items:
-    - "{{ devices }}"
-  changed_when: false
-  failed_when: false
-  check_mode: no
-  register: osd_partition_status_results
-
-# NOTE: The following calls to sgdisk are retried because sgdisk is known to
-# fully wipe a device the first time around. There is no need to halt execution
-# of zapping the whole device so these try again. It is easier to use `||` to
-# keep the current flow of the task.
-# See: https://github.com/ceph/ceph-ansible/issues/759
-- name: fix partitions gpt header or labels of the osd disks
-  shell: "sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }} || sgdisk --zap-all --clear --mbrtogpt -- {{ item.1 }}"
-  with_together:
-    - "{{ osd_partition_status_results.results }}"
-    - "{{ devices }}"
-  changed_when: false
-  when:
-    - not item.0.get("skipped")
-    - item.0.get("rc", 0) != 0
-    - not containerized_deployment
-
-- name: create gpt disk label
-  command: parted --script {{ item.1 }} mklabel gpt
-  with_together:
-    - "{{ osd_partition_status_results.results }}"
-    - "{{ devices }}"
-  changed_when: false
-  when:
-    - not item.0.get("skipped")
-    - item.0.get("rc", 0) != 0
-    - containerized_deployment
index 0fce26e3a4320da421ef58f02d45a90022ee6788..65234eff77536581c69b8b36f7c4fa01c762c5d2 100644 (file)
 - name: include ceph_disk_cli_options_facts.yml
   include: ceph_disk_cli_options_facts.yml
 
-- name: set_fact devices generate device list when osd_auto_discovery
-  set_fact:
-    devices: "{{ devices | default([]) + [ item.key | regex_replace('^', '/dev/') ] }}"
-  with_dict: "{{ ansible_devices }}"
-  when:
-    - osd_auto_discovery
-    - ansible_devices is defined
-    - item.value.removable == "0"
-    - item.value.sectors != "0"
-    - item.value.partitions|count == 0
-    - item.value.holders|count == 0
-    - "'dm-' not in item.key"
-
-- name: include check_devices.yml
-  include: check_devices.yml
-  when:
-    - not osd_auto_discovery
+- name: include build_devices.yml
+  include: build_devices.yml
 
 - name: check if a partition named 'ceph' exists
   shell: "parted --script {{ item }} print | egrep -sq '^ 1.*ceph'"
index f80e364cf6a0147d449ec34b9c764924945faac3..caa91d0848f9023d09925bbe0116bcc1e7cc613f 100644 (file)
@@ -6,7 +6,7 @@ cluster: test
 monitor_interface: eth1
 public_network: "192.168.35.0/24"
 cluster_network: "192.168.36.0/24"
-ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
+ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }}
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1
index d703a67c3b8d7d6b92aa71895f068738268215c4..50870793d3591e0ca28337eaa318394bf10e99e1 100644 (file)
@@ -15,7 +15,7 @@ cluster_network: "192.168.16.0/24"
 osd_scenario: collocated
 ceph_rgw_civetweb_port: 8080
 osd_objectstore: filestore
-ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
+ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }}
 devices:
   - /dev/sda
   - /dev/sdb
index 5fe27d9898b42080ac2d2381de5098c0352e1a03..ee108ac786d8d0c676408d7793013bce6396704c 100644 (file)
@@ -15,7 +15,7 @@ cluster_network: "192.168.18.0/24"
 osd_scenario: collocated
 ceph_rgw_civetweb_port: 8080
 osd_objectstore: filestore
-ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
+ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }}
 devices:
   - '/dev/disk/by-id/ata-QEMU_HARDDISK_QM00001'
   - /dev/sdb
index ad222a98034235239a475948fc272d58c0dbe409..7afcac550647d73a5ee06b29aa0bbcbb65966256 100644 (file)
@@ -6,7 +6,7 @@ cluster: test
 monitor_interface: eth1
 public_network: "192.168.55.0/24"
 cluster_network: "192.168.56.0/24"
-ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }} -e OSD_FORCE_ZAP=1
+ceph_osd_docker_prepare_env: -e OSD_JOURNAL_SIZE={{ journal_size }}
 ceph_conf_overrides:
   global:
     osd_pool_default_size: 1