-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify that disk volumes are mounted by UUID in fstab #50
Conversation
here's what happens:
...
and the repeated invocation changes it to mount by UUID:
...
(copied from 36da735#r35511810 ) |
The rules are a bit more complicated. Device-mapper devices are generally listed by path instead of by UUID since that path can only change as a direct result of the user changing it, as opposed to partitions or disks which can change arbitrarily depending on device detection ordering. I am definitely open to verifying that the correct identifier is used, but it will have to be a bit more complex than this. |
This probably merits an explanation. In blivet, the backing device will have a format of type 'luks'. This is the encrypted, or backing, device. The next layer out is a LUKSDevice, which represents the (decrypted/open) device-mapper device. Because the LUKS layer is optional and can be effectively toggled, there are many occasions on which it is convenient to look past the LUKS layer directly to the backing device. For this purpose, all of blivet's StorageDevice classes have a 'raw_device' property. For unexcrypted leaf devices, the raw device is the same as the actual device. For encrypted leaf devices, the raw device points to the backing device. In other words, adding _raw_device establishes a line between the raw/backing/encrypted device and the decrypted/mapped/open device which makes test validation quite a bit easier.
Doing so for all formats can trigger deactivation of device stacks that needlessly complicates things.
Relying on _reformat to create the formatting worked because a DiskDevice always exists. Now that self._device can be an optional, non-existent, LUKS layer on top of the disk we have to make the disk volume class behave more like the other volume classes -- namely, it has to create its format as part of _create since we will not always call _reformat (eg: when we've set up, but not yet created, a new LUKS layer on the disk).
Note that disk volumes mean filesystems directly on disks. Currently the test fails: on first invocation the filesystem gets mounted by device name and only on the second by UUID. This should be also aught by a real idempotence test. XXX this should be part of the existing verification task lists: there is already a task called "Verify that the device identifier appears in /etc/fstab", but it does not check for this condition.
@@ -6,7 +6,7 @@ | |||
mount_location: '/opt/test' | |||
volume_size: '5g' | |||
fs_type_after: "{{ 'ext3' if (ansible_distribution == 'RedHat' and ansible_distribution_major_version == '6') else 'ext4' }}" | |||
|
|||
pat: "{{ '^([^#\\s]+)\\s+' + mount_location + '\\s.*' }}" | |||
tasks: | |||
- include_role: | |||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
tasks: | ||
- include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
block: | ||
- name: Create an encrypted disk volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
# encrypted disk volume | ||
- name: Create an encrypted disk volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Remove the encryption layer | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Add encryption to the volume | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
block: | ||
- name: Create an encrypted partition volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Create an encrypted partition volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Remove the encryption layer | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Add encryption to the volume | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
block: | ||
- name: Create an encrypted lvm volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Create an encrypted lvm volume w/ default fs | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Remove the encryption layer | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
|
||
- name: Add encryption to the volume | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use name: linux-system-roles.storage
should we close this in favor of #104 ? |
[citest pending] |
[citest bad] |
[citest pending] |
|
||
- name: Clean up | ||
include_role: | ||
name: storage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more?
please use name: linux-system-roles.storage
[citest pending] |
2 similar comments
[citest pending] |
[citest pending] |
closing due to inactivity |
Note that disk volumes mean filesystems directly on disks.
Currently the test fails: on first invocation the filesystem gets mounted by device name and only on the second by UUID. This should be also caught by a real idempotence test.
XXX this should be part of the existing verification task lists: there is already a task called "Verify that the device identifier appears in /etc/fstab", but it does not check for this condition.