1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Tidy up validation for storage/zfs modules (#1766) (#1820)

* fixed validation-modules for plugins/modules/storage/zfs/zfs.py

* fixed validation-modules for plugins/modules/storage/zfs/zfs_delegate_admin.py

* fixed validation-modules for plugins/modules/storage/zfs/zfs_facts.py

* fixed validation-modules for plugins/modules/storage/zfs/zpool_facts.py

* Tidy up validate-modules ignores for storage/zfs modules

* removed ignore lines in 2.11 files as well

* added changelog fragment per PR

* Update changelogs/fragments/1766-zfs-fixed-sanity.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit bd372939bc)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2021-02-15 08:07:53 +01:00 committed by GitHub
parent 0f91fea501
commit f8a9ac1048
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 17 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- zfs_delegate_admin - the elements of ``users``, ``groups`` and ``permissions`` are now enforced to be strings (https://github.com/ansible-collections/community.general/pull/1766).

View file

@ -19,6 +19,7 @@ options:
description:
- File system, snapshot or volume name e.g. C(rpool/myfs).
required: true
type: str
state:
description:
- Whether to create (C(present)), or remove (C(absent)) a
@ -26,13 +27,16 @@ options:
will be created/destroyed as needed to reach the desired state.
choices: [ absent, present ]
required: true
type: str
origin:
description:
- Snapshot from which to create a clone.
type: str
extra_zfs_properties:
description:
- A dictionary of zfs properties to be set.
- See the zfs(8) man page for more information.
type: dict
author:
- Johan Wiren (@johanwiren)
'''

View file

@ -32,14 +32,17 @@ options:
- When set to C(absent), removes permissions from the specified entities, or removes all permissions if no entity params are specified.
choices: [ absent, present ]
default: present
type: str
users:
description:
- List of users to whom permission(s) should be granted.
type: list
elements: str
groups:
description:
- List of groups to whom permission(s) should be granted.
type: list
elements: str
everyone:
description:
- Apply permissions to everyone.
@ -50,6 +53,7 @@ options:
- The list of permission(s) to delegate (required if C(state) is C(present)).
type: list
choices: [ allow, clone, create, destroy, diff, hold, mount, promote, readonly, receive, release, rename, rollback, send, share, snapshot, unallow ]
elements: str
local:
description:
- Apply permissions to C(name) locally (C(zfs allow -l)).
@ -241,10 +245,10 @@ def main():
argument_spec=dict(
name=dict(type='str', required=True),
state=dict(type='str', default='present', choices=['absent', 'present']),
users=dict(type='list'),
groups=dict(type='list'),
users=dict(type='list', elements='str'),
groups=dict(type='list', elements='str'),
everyone=dict(type='bool', default=False),
permissions=dict(type='list',
permissions=dict(type='list', elements='str',
choices=['allow', 'clone', 'create', 'destroy', 'diff', 'hold', 'mount', 'promote',
'readonly', 'receive', 'release', 'rename', 'rollback', 'send', 'share',
'snapshot', 'unallow']),

View file

@ -21,6 +21,7 @@ options:
- ZFS dataset name.
required: yes
aliases: [ "ds", "dataset" ]
type: str
recurse:
description:
- Specifies if properties for any children should be recursively
@ -38,15 +39,18 @@ options:
- Specifies which dataset properties should be queried in comma-separated format.
For more information about dataset properties, check zfs(1M) man page.
default: all
type: str
type:
description:
- Specifies which datasets types to display. Multiple values have to be
provided in comma-separated form.
choices: [ 'all', 'filesystem', 'volume', 'snapshot', 'bookmark' ]
default: all
type: str
depth:
description:
- Specifies recursion depth.
type: int
'''
EXAMPLES = '''

View file

@ -19,6 +19,7 @@ options:
name:
description:
- ZFS pool name.
type: str
aliases: [ "pool", "zpool" ]
required: false
parsable:
@ -32,6 +33,7 @@ options:
description:
- Specifies which dataset properties should be queried in comma-separated format.
For more information about dataset properties, check zpool(1M) man page.
type: str
default: all
required: false
'''

View file

@ -504,11 +504,6 @@ plugins/modules/storage/purestorage/purefa_facts.py validate-modules:parameter-l
plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:parameter-list-no-elements
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/storage/zfs/zfs.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_delegate_admin.py validate-modules:parameter-list-no-elements
plugins/modules/storage/zfs/zfs_delegate_admin.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zpool_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/alternatives.py pylint:blacklisted-name
plugins/modules/system/beadm.py pylint:blacklisted-name
plugins/modules/system/cronvar.py pylint:blacklisted-name

View file

@ -492,11 +492,6 @@ plugins/modules/storage/purestorage/purefa_facts.py validate-modules:parameter-l
plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-syntax-error
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:parameter-list-no-elements
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/storage/zfs/zfs.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_delegate_admin.py validate-modules:parameter-list-no-elements
plugins/modules/storage/zfs/zfs_delegate_admin.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zpool_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/alternatives.py pylint:blacklisted-name
plugins/modules/system/beadm.py pylint:blacklisted-name
plugins/modules/system/cronvar.py pylint:blacklisted-name

View file

@ -452,10 +452,6 @@ plugins/modules/storage/purestorage/purefa_facts.py validate-modules:return-synt
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:deprecation-mismatch
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:invalid-documentation
plugins/modules/storage/purestorage/purefb_facts.py validate-modules:return-syntax-error
plugins/modules/storage/zfs/zfs.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_delegate_admin.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zfs_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/storage/zfs/zpool_facts.py validate-modules:parameter-type-not-in-doc
plugins/modules/system/alternatives.py pylint:blacklisted-name
plugins/modules/system/beadm.py pylint:blacklisted-name
plugins/modules/system/cronvar.py pylint:blacklisted-name