�
�Udac @` s� d d l m Z m Z m Z e Z i d g d 6d d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
d
e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functiont previewt statust communityt supported_bys 1.1t metadata_versions�
---
module: zfs_delegate_admin
short_description: Manage ZFS delegated administration (user admin privileges)
description:
- Manages ZFS file system delegated administration permissions, which allow unprivileged users to perform ZFS
operations normally restricted to the superuser.
- See the C(zfs allow) section of C(zfs(1M)) for detailed explanations of options.
- This module attempts to adhere to the behavior of the command line tool as much as possible.
requirements:
- "A ZFS/OpenZFS implementation that supports delegation with `zfs allow`, including: Solaris >= 10, illumos (all
versions), FreeBSD >= 8.0R, ZFS on Linux >= 0.7.0."
version_added: '2.8'
options:
name:
description:
- File system or volume name e.g. C(rpool/myfs).
required: true
type: str
state:
description:
- Whether to allow (C(present)), or unallow (C(absent)) a permission.
- When set to C(present), at least one "entity" param of I(users), I(groups), or I(everyone) are required.
- When set to C(absent), removes permissions from the specified entities, or removes all permissions if no entity params are specified.
required: true
choices: [ absent, present ]
default: present
users:
description:
- List of users to whom permission(s) should be granted.
type: list
groups:
description:
- List of groups to whom permission(s) should be granted.
type: list
everyone:
description:
- Apply permissions to everyone.
type: bool
default: no
permissions:
description:
- 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 ]
local:
description:
- Apply permissions to C(name) locally (C(zfs allow -l)).
type: bool
descendents:
description:
- Apply permissions to C(name)'s descendents (C(zfs allow -d)).
type: bool
recursive:
description:
- Unallow permissions recursively (ignored when C(state) is C(present)).
type: bool
default: no
author:
- Nate Coraor (@natefoo)
s�
- name: Grant `zfs allow` and `unallow` permission to the `adm` user with the default local+descendents scope
zfs_delegate_admin:
name: rpool/myfs
users: adm
permissions: allow,unallow
- name: Grant `zfs send` to everyone, plus the group `backup`
zfs_delegate_admin:
name: rpool/myvol
groups: backup
everyone: yes
permissions: send
- name: Grant `zfs send,receive` to users `foo` and `bar` with local scope only
zfs_delegate_admin:
name: rpool/myfs
users: foo,bar
permissions: send,receive
local: yes
- name: Revoke all permissions from everyone (permissions specifically assigned to users and groups remain)
- zfs_delegate_admin:
name: rpool/myfs
everyone: yes
state: absent
t
( t product( t
AnsibleModulet ZfsDelegateAdminc B` s\ e Z d � Z d � Z e d � � Z d d d � Z d � Z d � Z d � Z
d � Z RS( c C` s� | | _ | j j d � | _ | j j d � | _ | j j d � | _ | j j d � | _ | j j d � | _ | j j d � | _ d | _
t | _ d | _
d | _ g | _ | j | _ | j | � d S( Nt namet statet userst groupst everyonet permissionst allow( t modulet paramst getR R
R R R t permst Nonet scopet Falset changedt
initial_permst
subcommandt
recursive_optt updatet
run_methodt setup( t selfR ( ( sR /usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_delegate_admin.pyt __init__s s c C` s7 | j d k r<