diff --git a/tests/roles/bootstrap-host/defaults/main.yml b/tests/roles/bootstrap-host/defaults/main.yml index a73169be36..d7b38c9a7f 100644 --- a/tests/roles/bootstrap-host/defaults/main.yml +++ b/tests/roles/bootstrap-host/defaults/main.yml @@ -168,6 +168,7 @@ bootstrap_host_data_disk2_formats: xfs: xfs dir: ext4 lvm: ext2 + overlayfs: ext4 bootstrap_host_format_options: btrfs: '--metadata single --data single --mixed' @@ -178,15 +179,15 @@ bootstrap_host_format_options: # Set the data disk mount options. bootstrap_host_data_mount_options: zfs: "defaults" - btrfs: "noatime,nodiratime,compress=lzo,commit=120,space_cache=v2 }}" + btrfs: "noatime,nodiratime,compress=lzo,commit=120,space_cache=v2" xfs: "noatime,nodiratime,logbufs=8,logbsize=256k" ext4: "noatime,nobh,barrier=0,data=writeback" dir: "defaults" lvm: "defaults" swap: "%%" -bootstrap_host_data_disk2_fs: "{{ bootstrap_host_data_disk2_formats[lxc_container_backing_store] }}" -bootstrap_host_data_disk2_fs_mount_options: "{{ bootstrap_host_data_mount_options[lxc_container_backing_store] }}" +bootstrap_host_data_disk2_fs: "{{ bootstrap_host_data_disk2_formats[_lxc_container_backing_store] }}" +bootstrap_host_data_disk2_fs_mount_options: "{{ bootstrap_host_data_mount_options[bootstrap_host_data_disk2_fs] }}" bootstrap_host_data_disk2_path: '/var/lib/lxc' ### Optional Settings ### @@ -198,6 +199,3 @@ bootstrap_host_data_disk2_path: '/var/lib/lxc' # Set the install method for the deployment. Options are ['source', 'distro'] bootstrap_host_install_method: "{{ lookup('env', 'INSTALL_METHOD') | default('source', true) }}" - -# Set the lxc backing store for the job -lxc_container_backing_store: dir diff --git a/tests/roles/bootstrap-host/tasks/main.yml b/tests/roles/bootstrap-host/tasks/main.yml index d90f1fc8a9..bd9768af1a 100644 --- a/tests/roles/bootstrap-host/tasks/main.yml +++ b/tests/roles/bootstrap-host/tasks/main.yml @@ -95,7 +95,7 @@ when: - bootstrap_host_loopback_zfs | bool - bootstrap_host_data_disk_device == None - - lxc_container_backing_store == 'zfs' + - _lxc_container_backing_store == 'zfs' args: apply: tags: @@ -108,7 +108,7 @@ when: - bootstrap_host_loopback_btrfs | bool - bootstrap_host_data_disk_device == None - - lxc_container_backing_store == 'btrfs' + - _lxc_container_backing_store == 'btrfs' args: apply: tags: diff --git a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml index 12c68794fe..f489ccf2d6 100644 --- a/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml +++ b/tests/roles/bootstrap-host/tasks/prepare_data_disk.yml @@ -77,8 +77,8 @@ opts: "{{ bootstrap_host_format_options[bootstrap_host_data_disk2_fs] | default(omit) }}" when: - bootstrap_host_data_disk_device_force | bool - - lxc_container_backing_store != 'lvm' - - lxc_container_backing_store != 'zfs' + - _lxc_container_backing_store != 'lvm' + - _lxc_container_backing_store != 'zfs' tags: - format-data-partitions @@ -108,8 +108,8 @@ state: 'started' enabled: true when: - - lxc_container_backing_store != 'lvm' - - lxc_container_backing_store != 'zfs' + - _lxc_container_backing_store != 'lvm' + - _lxc_container_backing_store != 'zfs' tags: - data-config @@ -119,13 +119,13 @@ creates: /pool when: - bootstrap_host_data_disk_device_force | bool - - lxc_container_backing_store == 'zfs' + - _lxc_container_backing_store == 'zfs' - name: Create the ZFS pool/lxc volume shell: "(zfs list | grep lxc) || zfs create -o mountpoint=/var/lib/lxc pool/lxc" when: - bootstrap_host_data_disk_device_force | bool - - lxc_container_backing_store == 'zfs' + - _lxc_container_backing_store == 'zfs' tags: - skip_ansible_lint @@ -134,7 +134,7 @@ args: creates: "/openstack/lxc.pvcreate" when: - - lxc_container_backing_store == 'lvm' + - _lxc_container_backing_store == 'lvm' tags: - skip_ansible_lint - data-config @@ -143,7 +143,7 @@ command: "pvscan" changed_when: false when: - - lxc_container_backing_store == 'lvm' + - _lxc_container_backing_store == 'lvm' tags: - cinder-lvm-pv @@ -152,6 +152,6 @@ vg: lxc pvs: "/dev/{{ _bootstrap_host_data_disk_device }}2" when: - - lxc_container_backing_store == 'lvm' + - _lxc_container_backing_store == 'lvm' tags: - data-config diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index 75fcb59045..0d1e7ca0d7 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -229,9 +229,10 @@ lxc_image_cache_server_mirrors: cache_timeout: {{ cache_timeout }} {% endif %} -# The container backing store is set to 'machinectl' to speed up the -# AIO build time. Options are: [machinectl, overlayfs, btrfs, zfs, dir, lvm] -lxc_container_backing_store: "{{ lxc_container_backing_store }}" +lxc_container_backing_store: {{ _lxc_container_backing_store }} +{% if _lxc_container_backing_store == 'zfs' %} +lxc_container_zfs_root_name: "osa-test-pool/lxc" +{% endif %} # bind mount the zuul repos into the containers lxc_container_bind_mounts: diff --git a/tests/roles/bootstrap-host/vars/main.yml b/tests/roles/bootstrap-host/vars/main.yml index ea51d55266..97ec0f087d 100644 --- a/tests/roles/bootstrap-host/vars/main.yml +++ b/tests/roles/bootstrap-host/vars/main.yml @@ -15,6 +15,22 @@ bootstrap_host_scenarios: "{{ (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list }}" +_lxc_container_backing_store: |- + {% if 'zfs' in bootstrap_host_scenarios %} + {% set store = 'zfs' %} + {% elif 'btrfs' in bootstrap_host_scenarios %} + {% set store = 'btrfs' %} + {% elif 'dir' in bootstrap_host_scenarios %} + {% set store = 'dir' %} + {% elif 'lvm' in bootstrap_host_scenarios %} + {% set store = 'lvm' %} + {% elif 'overlayfs' in bootstrap_host_scenarios %} + {% set store = 'overlayfs' %} + {% else %} + {% set store = 'dir' %} + {% endif %} + {{ store }} + # Expand the scenario list to include specific services that are being deployed # as part of the scenario bootstrap_host_scenarios_expanded: |-