f30a08d049
* Add fat filesystem support fatresize is temporarily disabled * Refactor Filesystem.get_dev_size For more sharing with vFAT class * Fix filesystem tests on some OSs I think this is due to older mke2fs on those systems. * Fix vFAT command on FreeBSD newfs doesn't seem to work on image files * Refactor filesystem.grow() Split out grow_cmd generation and Device operations * Use swap as unsupported filesystem Except FreeBSD, which doesn't have mkswap * Be consistent about str(dev) vs dev.path Prefer str(dev), this works transparently with '%s' formatting. * Enable vfat resize, only test fatresize >= 1.0.4 Lower versions have a segfault bug. * Only install fatresize where available FreeBSD, OpenSUSE, RHEL and CentOS < 7 don't ship it.
39 lines
1 KiB
YAML
39 lines
1 KiB
YAML
- name: 'Recreate "disk" file'
|
|
command: 'dd if=/dev/zero of={{ dev }} bs=1M count={{ fssize }}'
|
|
|
|
- name: 'Create a swap filesystem'
|
|
command: 'mkswap {{ dev }}'
|
|
|
|
- command: 'blkid -c /dev/null -o value -s UUID {{ dev }}'
|
|
register: uuid
|
|
|
|
- name: "Check that an existing filesystem (not handled by this module) isn't overwritten when force isn't used"
|
|
filesystem:
|
|
dev: '{{ dev }}'
|
|
fstype: '{{ fstype }}'
|
|
register: fs_result
|
|
ignore_errors: True
|
|
|
|
- command: 'blkid -c /dev/null -o value -s UUID {{ dev }}'
|
|
register: uuid2
|
|
|
|
- assert:
|
|
that:
|
|
- 'fs_result is failed'
|
|
- 'uuid.stdout == uuid2.stdout'
|
|
|
|
- name: "Check that an existing filesystem (not handled by this module) is overwritten when force is used"
|
|
filesystem:
|
|
dev: '{{ dev }}'
|
|
fstype: '{{ fstype }}'
|
|
force: yes
|
|
register: fs_result2
|
|
|
|
- command: 'blkid -c /dev/null -o value -s UUID {{ dev }}'
|
|
register: uuid3
|
|
|
|
- assert:
|
|
that:
|
|
- 'fs_result2 is successful'
|
|
- 'fs_result2 is changed'
|
|
- 'uuid2.stdout != uuid3.stdout'
|