Allow lxc container backing store to be defined as part of the scenario
This will allow aio_lxc_zfs, and a migration path away from openstack-ansible-tests repo for the lxc_hosts and lxc_container_create roles. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/842999 Change-Id: Ifb62f8b7e6d835d6aab84e85e35f55b89d01d115
This commit is contained in:
parent
cb76d3051b
commit
ff746bfefe
@ -168,6 +168,7 @@ bootstrap_host_data_disk2_formats:
|
|||||||
xfs: xfs
|
xfs: xfs
|
||||||
dir: ext4
|
dir: ext4
|
||||||
lvm: ext2
|
lvm: ext2
|
||||||
|
overlayfs: ext4
|
||||||
|
|
||||||
bootstrap_host_format_options:
|
bootstrap_host_format_options:
|
||||||
btrfs: '--metadata single --data single --mixed'
|
btrfs: '--metadata single --data single --mixed'
|
||||||
@ -178,15 +179,15 @@ bootstrap_host_format_options:
|
|||||||
# Set the data disk mount options.
|
# Set the data disk mount options.
|
||||||
bootstrap_host_data_mount_options:
|
bootstrap_host_data_mount_options:
|
||||||
zfs: "defaults"
|
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"
|
xfs: "noatime,nodiratime,logbufs=8,logbsize=256k"
|
||||||
ext4: "noatime,nobh,barrier=0,data=writeback"
|
ext4: "noatime,nobh,barrier=0,data=writeback"
|
||||||
dir: "defaults"
|
dir: "defaults"
|
||||||
lvm: "defaults"
|
lvm: "defaults"
|
||||||
swap: "%%"
|
swap: "%%"
|
||||||
|
|
||||||
bootstrap_host_data_disk2_fs: "{{ bootstrap_host_data_disk2_formats[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[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'
|
bootstrap_host_data_disk2_path: '/var/lib/lxc'
|
||||||
|
|
||||||
### Optional Settings ###
|
### 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']
|
# Set the install method for the deployment. Options are ['source', 'distro']
|
||||||
bootstrap_host_install_method: "{{ lookup('env', 'INSTALL_METHOD') | default('source', true) }}"
|
bootstrap_host_install_method: "{{ lookup('env', 'INSTALL_METHOD') | default('source', true) }}"
|
||||||
|
|
||||||
# Set the lxc backing store for the job
|
|
||||||
lxc_container_backing_store: dir
|
|
||||||
|
@ -95,7 +95,7 @@
|
|||||||
when:
|
when:
|
||||||
- bootstrap_host_loopback_zfs | bool
|
- bootstrap_host_loopback_zfs | bool
|
||||||
- bootstrap_host_data_disk_device == None
|
- bootstrap_host_data_disk_device == None
|
||||||
- lxc_container_backing_store == 'zfs'
|
- _lxc_container_backing_store == 'zfs'
|
||||||
args:
|
args:
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
@ -108,7 +108,7 @@
|
|||||||
when:
|
when:
|
||||||
- bootstrap_host_loopback_btrfs | bool
|
- bootstrap_host_loopback_btrfs | bool
|
||||||
- bootstrap_host_data_disk_device == None
|
- bootstrap_host_data_disk_device == None
|
||||||
- lxc_container_backing_store == 'btrfs'
|
- _lxc_container_backing_store == 'btrfs'
|
||||||
args:
|
args:
|
||||||
apply:
|
apply:
|
||||||
tags:
|
tags:
|
||||||
|
@ -77,8 +77,8 @@
|
|||||||
opts: "{{ bootstrap_host_format_options[bootstrap_host_data_disk2_fs] | default(omit) }}"
|
opts: "{{ bootstrap_host_format_options[bootstrap_host_data_disk2_fs] | default(omit) }}"
|
||||||
when:
|
when:
|
||||||
- bootstrap_host_data_disk_device_force | bool
|
- bootstrap_host_data_disk_device_force | bool
|
||||||
- lxc_container_backing_store != 'lvm'
|
- _lxc_container_backing_store != 'lvm'
|
||||||
- lxc_container_backing_store != 'zfs'
|
- _lxc_container_backing_store != 'zfs'
|
||||||
tags:
|
tags:
|
||||||
- format-data-partitions
|
- format-data-partitions
|
||||||
|
|
||||||
@ -108,8 +108,8 @@
|
|||||||
state: 'started'
|
state: 'started'
|
||||||
enabled: true
|
enabled: true
|
||||||
when:
|
when:
|
||||||
- lxc_container_backing_store != 'lvm'
|
- _lxc_container_backing_store != 'lvm'
|
||||||
- lxc_container_backing_store != 'zfs'
|
- _lxc_container_backing_store != 'zfs'
|
||||||
tags:
|
tags:
|
||||||
- data-config
|
- data-config
|
||||||
|
|
||||||
@ -119,13 +119,13 @@
|
|||||||
creates: /pool
|
creates: /pool
|
||||||
when:
|
when:
|
||||||
- bootstrap_host_data_disk_device_force | bool
|
- bootstrap_host_data_disk_device_force | bool
|
||||||
- lxc_container_backing_store == 'zfs'
|
- _lxc_container_backing_store == 'zfs'
|
||||||
|
|
||||||
- name: Create the ZFS pool/lxc volume
|
- name: Create the ZFS pool/lxc volume
|
||||||
shell: "(zfs list | grep lxc) || zfs create -o mountpoint=/var/lib/lxc pool/lxc"
|
shell: "(zfs list | grep lxc) || zfs create -o mountpoint=/var/lib/lxc pool/lxc"
|
||||||
when:
|
when:
|
||||||
- bootstrap_host_data_disk_device_force | bool
|
- bootstrap_host_data_disk_device_force | bool
|
||||||
- lxc_container_backing_store == 'zfs'
|
- _lxc_container_backing_store == 'zfs'
|
||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
|
|
||||||
@ -134,7 +134,7 @@
|
|||||||
args:
|
args:
|
||||||
creates: "/openstack/lxc.pvcreate"
|
creates: "/openstack/lxc.pvcreate"
|
||||||
when:
|
when:
|
||||||
- lxc_container_backing_store == 'lvm'
|
- _lxc_container_backing_store == 'lvm'
|
||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- skip_ansible_lint
|
||||||
- data-config
|
- data-config
|
||||||
@ -143,7 +143,7 @@
|
|||||||
command: "pvscan"
|
command: "pvscan"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
when:
|
when:
|
||||||
- lxc_container_backing_store == 'lvm'
|
- _lxc_container_backing_store == 'lvm'
|
||||||
tags:
|
tags:
|
||||||
- cinder-lvm-pv
|
- cinder-lvm-pv
|
||||||
|
|
||||||
@ -152,6 +152,6 @@
|
|||||||
vg: lxc
|
vg: lxc
|
||||||
pvs: "/dev/{{ _bootstrap_host_data_disk_device }}2"
|
pvs: "/dev/{{ _bootstrap_host_data_disk_device }}2"
|
||||||
when:
|
when:
|
||||||
- lxc_container_backing_store == 'lvm'
|
- _lxc_container_backing_store == 'lvm'
|
||||||
tags:
|
tags:
|
||||||
- data-config
|
- data-config
|
||||||
|
@ -229,9 +229,10 @@ lxc_image_cache_server_mirrors:
|
|||||||
cache_timeout: {{ cache_timeout }}
|
cache_timeout: {{ cache_timeout }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
# The container backing store is set to 'machinectl' to speed up the
|
lxc_container_backing_store: {{ _lxc_container_backing_store }}
|
||||||
# AIO build time. Options are: [machinectl, overlayfs, btrfs, zfs, dir, lvm]
|
{% if _lxc_container_backing_store == 'zfs' %}
|
||||||
lxc_container_backing_store: "{{ lxc_container_backing_store }}"
|
lxc_container_zfs_root_name: "osa-test-pool/lxc"
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
# bind mount the zuul repos into the containers
|
# bind mount the zuul repos into the containers
|
||||||
lxc_container_bind_mounts:
|
lxc_container_bind_mounts:
|
||||||
|
@ -15,6 +15,22 @@
|
|||||||
|
|
||||||
bootstrap_host_scenarios: "{{ (bootstrap_host_scenario.split('_') | reject('equalto', '')) | list }}"
|
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
|
# Expand the scenario list to include specific services that are being deployed
|
||||||
# as part of the scenario
|
# as part of the scenario
|
||||||
bootstrap_host_scenarios_expanded: |-
|
bootstrap_host_scenarios_expanded: |-
|
||||||
|
Loading…
Reference in New Issue
Block a user