Merge "Add option to change fs type on bootstrap device"

This commit is contained in:
Zuul 2018-07-03 12:04:05 +00:00 committed by Gerrit Code Review
commit bb749eac3d
3 changed files with 16 additions and 6 deletions

View File

@ -132,6 +132,13 @@ on the device, then execute:
# export BOOTSTRAP_OPTS="bootstrap_host_data_disk_device=sdb"
By default the filesystem type will be set to ext4, if you want another type
of filesystem to be used, just use something similar to the following:
.. code-block:: shell-session
# export BOOTSTRAP_OPTS="bootstrap_host_data_disk_device=sdb bootstrap_host_data_disk_fs_type=xfs"
Additional options may be implemented by simply concatenating them with
a space between each set of options, for example:

View File

@ -223,6 +223,9 @@ bridge_iptables_rules: |
# set the full path to the device. IE: "/dev/xvde" should be "xvde".
bootstrap_host_data_disk_device: null
#
# Specify the default filesystem type
bootstrap_host_data_disk_fs_type: ext4
#
# Boolean value to force the repartitioning of the secondary device.
bootstrap_host_data_disk_device_force: no
#

View File

@ -20,7 +20,7 @@
# in case these tasks are executed multiple times.
- name: Determine whether partitions labeled openstack-data{1,2} are present
shell: |
parted --script -l -m | egrep -q ':ext4:openstack-data[12]:;$'
parted --script -l -m | egrep -q ':{{ bootstrap_host_data_disk_fs_type }}:openstack-data[12]:;$'
register: data_disk_partitions
changed_when: false
failed_when: false
@ -38,7 +38,7 @@
mount:
name: "{{ item.mount }}"
src: "{{ item.device }}"
fstype: ext4
fstype: "{{ bootstrap_host_data_disk_fs_type }}"
state: absent
when:
- bootstrap_host_data_disk_device_force | bool
@ -52,14 +52,14 @@
- 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-data1 {{ bootstrap_host_data_disk_fs_type }} 0% 40%"
- "parted --align optimal --script /dev/{{ _bootstrap_host_data_disk_device }} mkpart openstack-data2 {{ bootstrap_host_data_disk2_fs }} 40% 100%"
tags:
- create-data-disk-partitions
- name: Format the partition 1
filesystem:
fstype: ext4
fstype: "{{ bootstrap_host_data_disk_fs_type }}"
dev: "/dev/{{ _bootstrap_host_data_disk_device }}1"
opts: "{{ bootstrap_host_format_options['ext4'] | default(omit) }}"
when:
@ -87,8 +87,8 @@
systemd_mounts:
- what: "/dev/{{ _bootstrap_host_data_disk_device }}1"
where: "/openstack"
type: "ext4"
options: "{{ bootstrap_host_data_mount_options['ext4'] }}"
type: "{{ bootstrap_host_data_disk_fs_type }}"
options: "{{ bootstrap_host_data_mount_options[bootstrap_host_data_disk_fs_type] }}"
state: 'started'
enabled: true
tags: