From f785060cfcff4224c64885a5294335b2bb9b2c5f Mon Sep 17 00:00:00 2001 From: Jameson Finney Date: Tue, 18 Oct 2016 20:51:59 -0400 Subject: [PATCH] Adds support for disks on HP Smart Array Controllers This commit adds handling for RAID controllers which use the cciss driver. Ansible detects devices attached to this driver with the format of 'cciss!c#d#', whereas commands run using the ansible provided name expect the format of 'cciss/c#d#' or 'cciss/c#d#p#'. Change-Id: I4062a5df0dd5a05e08aac566d3f564a081bebd01 Closes-Bug: #1634318 --- .../bootstrap-host/tasks/prepare_data_disk.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml index 7f5c731473..89284c7184 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml @@ -43,20 +43,20 @@ shell: "{{ item }}" when: data_disk_partitions.rc == 1 or bootstrap_host_data_disk_device_force | bool with_items: - - "parted --script /dev/{{ bootstrap_host_data_disk_device }} mklabel gpt" - - "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device }} mkpart openstack-data1 ext4 0% 40%" - - "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device }} mkpart openstack-data2 ext4 40% 100%" + - "parted --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mklabel gpt" + - "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mkpart openstack-data1 ext4 0% 40%" + - "parted --align optimal --script /dev/{{ bootstrap_host_data_disk_device | regex_replace('!','/') }} mkpart openstack-data2 ext4 40% 100%" tags: - create-data-disk-partitions - name: Format the partitions filesystem: fstype: ext4 - dev: "{{ item }}" + dev: "{{ item }}" when: data_disk_partitions.rc == 1 or bootstrap_host_data_disk_device_force | bool with_items: - - "/dev/{{ bootstrap_host_data_disk_device }}1" - - "/dev/{{ bootstrap_host_data_disk_device }}2" + - "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}1" + - "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}2" tags: - format-data-partitions @@ -67,7 +67,7 @@ fstype: ext4 state: mounted with_items: - - { mount_point: /openstack, device: "/dev/{{ bootstrap_host_data_disk_device }}1"} - - { mount_point: /var/lib/lxc, device: "/dev/{{ bootstrap_host_data_disk_device }}2"} + - { mount_point: /openstack, device: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}1"} + - { mount_point: /var/lib/lxc, device: "/dev/{{ bootstrap_host_data_disk_device | regex_replace('!(.*)$','/\\1p') }}2"} tags: - mount-data-partitions