Resolve btrfs backing store variable inconsistency

In Ica79472568799098ebf83c6cefc585f117975f37 some incorrect
variable names were used. This patch changes the variable
names to suit their purpose and ensures that they are used
consistently throughout the role.

Change-Id: If9e912641b5b6cb7791221b40dd4d56e215c2b98
This commit is contained in:
Jesse Pretorius 2019-01-07 14:24:44 +00:00
parent eade50c24b
commit a14dcc8489
4 changed files with 33 additions and 16 deletions

View File

@ -185,13 +185,15 @@ properties: {}
# host.
lxc_container_journal_link: true
# Enable or Disable the BTRFS quota system for the "/var/lib/machines" mount
# point. More information on the BTRFS quota system can be found here:
# Enable or Disable the BTRFS quota system, which is used for the
# "/var/lib/machines" mount point (for the machinectl backing store), or for
# any containers with a btrfs backing store. More information on the BTRFS
# quota system can be found here:
# * https://btrfs.wiki.kernel.org/index.php/Quota_support
lxc_host_machine_quota_disabled: false
lxc_host_btrfs_quota_disabled: false
# Set the default qgroup limits used for file system quotas. The default is
# "none". See the following documentation for more information:
# Set the default qgroup limits used for btrfs file system quotas. The default
# is "none". See the following documentation for more information:
# * https://btrfs.wiki.kernel.org/index.php/Manpage/btrfs-qgroup
lxc_host_machine_qgroup_space_limit: none
lxc_host_machine_qgroup_compression_limit: none
lxc_host_btrfs_qgroup_space_limit: none
lxc_host_btrfs_qgroup_compression_limit: none

View File

@ -0,0 +1,15 @@
---
fixes:
- |
When using LXC containers with a copy-on-write back-end, the ``lxc_hosts``
role execution would fail due to undefined variables with the
``nspawn_host_`` prefix. This issue has now been fixed.
deprecations:
- |
The following variable name changes have been implemented in order to
better reflect their purpose.
* ``lxc_host_machine_quota_disabled`` -> ``lxc_host_btrfs_quota_disabled``
* ``lxc_host_machine_qgroup_space_limit`` -> ``lxc_host_btrfs_qgroup_space_limit``
* ``lxc_host_machine_qgroup_compression_limit`` -> ``lxc_host_btrfs_qgroup_compression_limit``

View File

@ -38,23 +38,23 @@
when:
- lxc_container_info.rc != 0
- name: Set the qgroup limits
- name: Set the qgroup limits for btrfs backing stores
block:
- name: Set the qgroup size|compression limits on machines
command: "btrfs qgroup limit {{ item }} /var/lib/lxc/{{ inventory_hostname }}"
changed_when: false
delegate_to: "{{ physical_host }}"
with_items:
- "-e {{ nspawn_host_qgroup_space_limit }}"
- "-c {{ nspawn_host_qgroup_compression_limit }}"
- "-e {{ lxc_host_btrfs_qgroup_space_limit }}"
- "-c {{ lxc_host_btrfs_qgroup_compression_limit }}"
when:
- not nspawn_host_machine_quota_disabled
- not (lxc_host_btrfs_quota_disabled | bool)
rescue:
- name: Notice regarding quota system
debug:
msg: >-
There was an error processing the setup of qgroups. Check the system
to ensure they're available otherwise disable the quota system by
setting `nspawn_host_machine_quota_disabled` to true.
setting `lxc_host_btrfs_quota_disabled` to true.
when:
- lxc_container_backing_store == 'btrfs'

View File

@ -35,14 +35,14 @@
changed_when: false
delegate_to: "{{ physical_host }}"
with_items:
- "-e {{ lxc_host_machine_qgroup_space_limit }}"
- "-c {{ lxc_host_machine_qgroup_compression_limit }}"
- "-e {{ lxc_host_btrfs_qgroup_space_limit }}"
- "-c {{ lxc_host_btrfs_qgroup_compression_limit }}"
when:
- not lxc_host_machine_quota_disabled
- not (lxc_host_btrfs_quota_disabled | bool)
rescue:
- name: Notice regarding quota system
debug:
msg: >-
There was an error processing the setup of qgroups. Check the system
to ensure they're available otherwise disable the quota system by
setting `lxc_host_machine_quota_disabled` to true.
setting `lxc_host_btrfs_quota_disabled` to true.