mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 22:00:22 -07:00
Extend functionality of filesystem module to support swap creation (#49456)
* Extended functionality of filesystem module to support swap creation * Corrected documentation block * Add a note to for version added * was
This commit is contained in:
parent
8a30ceb347
commit
895c6eea9e
1 changed files with 9 additions and 2 deletions
|
@ -22,7 +22,7 @@ description:
|
||||||
version_added: "1.2"
|
version_added: "1.2"
|
||||||
options:
|
options:
|
||||||
fstype:
|
fstype:
|
||||||
choices: [ btrfs, ext2, ext3, ext4, ext4dev, f2fs, lvm, ocfs2, reiserfs, xfs, vfat ]
|
choices: [ btrfs, ext2, ext3, ext4, ext4dev, f2fs, lvm, ocfs2, reiserfs, xfs, vfat, swap ]
|
||||||
description:
|
description:
|
||||||
- Filesystem type to be created.
|
- Filesystem type to be created.
|
||||||
- reiserfs support was added in 2.2.
|
- reiserfs support was added in 2.2.
|
||||||
|
@ -31,6 +31,7 @@ options:
|
||||||
- vfat support was added in 2.5
|
- vfat support was added in 2.5
|
||||||
- ocfs2 support was added in 2.6
|
- ocfs2 support was added in 2.6
|
||||||
- f2fs support was added in 2.7
|
- f2fs support was added in 2.7
|
||||||
|
- swap support was added in 2.8
|
||||||
required: yes
|
required: yes
|
||||||
aliases: [type]
|
aliases: [type]
|
||||||
dev:
|
dev:
|
||||||
|
@ -46,7 +47,7 @@ options:
|
||||||
resizefs:
|
resizefs:
|
||||||
description:
|
description:
|
||||||
- If C(yes), if the block device and filesytem size differ, grow the filesystem into the space.
|
- If C(yes), if the block device and filesytem size differ, grow the filesystem into the space.
|
||||||
- Supported for C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs) and C(vfat) filesystems.
|
- Supported for C(ext2), C(ext3), C(ext4), C(ext4dev), C(f2fs), C(lvm), C(xfs), C(vfat), C(swap) filesystems.
|
||||||
- XFS Will only grow if mounted.
|
- XFS Will only grow if mounted.
|
||||||
- vFAT will likely fail if fatresize < 1.04.
|
- vFAT will likely fail if fatresize < 1.04.
|
||||||
type: bool
|
type: bool
|
||||||
|
@ -312,6 +313,11 @@ class LVM(Filesystem):
|
||||||
return block_count
|
return block_count
|
||||||
|
|
||||||
|
|
||||||
|
class Swap(Filesystem):
|
||||||
|
MKFS = 'mkswap'
|
||||||
|
MKFS_FORCE_FLAGS = '-f'
|
||||||
|
|
||||||
|
|
||||||
FILESYSTEMS = {
|
FILESYSTEMS = {
|
||||||
'ext2': Ext2,
|
'ext2': Ext2,
|
||||||
'ext3': Ext3,
|
'ext3': Ext3,
|
||||||
|
@ -324,6 +330,7 @@ FILESYSTEMS = {
|
||||||
'vfat': VFAT,
|
'vfat': VFAT,
|
||||||
'ocfs2': Ocfs2,
|
'ocfs2': Ocfs2,
|
||||||
'LVM2_member': LVM,
|
'LVM2_member': LVM,
|
||||||
|
'swap': Swap,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue