Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/zfs/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZdddddgZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: zfs_facts
short_description: Gather facts about ZFS datasets.
description:
  - Gather facts from ZFS dataset properties.
version_added: "2.3"
author: Adam Števko (@xen0l)
options:
    name:
        description:
            - ZFS dataset name.
        required: yes
        aliases: [ "ds", "dataset" ]
    recurse:
        description:
            - Specifies if properties for any children should be recursively
              displayed.
        type: bool
        default: 'no'
    parsable:
        description:
            - Specifies if property values should be displayed in machine
              friendly format.
        type: bool
        default: 'no'
    properties:
        description:
            - Specifies which dataset properties should be queried in comma-separated format.
              For more information about dataset properties, check zfs(1M) man page.
        default: all
        aliases: [ "props" ]
    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
    depth:
        description:
            - Specifies recursion depth.
sp
- name: Gather facts about ZFS dataset rpool/export/home
  zfs_facts:
    dataset: rpool/export/home

- name: Report space usage on ZFS filesystems under data/home
  zfs_facts:
    name: data/home
    recurse: yes
    type: filesystem

- debug:
    msg: 'ZFS dataset {{ item.name }} consumes {{ item.used }} of disk space.'
  with_items: '{{ ansible_zfs_datasets }}'
su

name:
    description: ZFS dataset name
    returned: always
    type: str
    sample: rpool/var/spool
parsable:
    description: if parsable output should be provided in machine friendly format.
    returned: if 'parsable' is set to True
    type: bool
    sample: True
recurse:
    description: if we should recurse over ZFS dataset
    returned: if 'recurse' is set to True
    type: bool
    sample: True
zfs_datasets:
    description: ZFS dataset facts
    returned: always
    type: str
    sample:
            {
                "aclinherit": "restricted",
                "aclmode": "discard",
                "atime": "on",
                "available": "43.8G",
                "canmount": "on",
                "casesensitivity": "sensitive",
                "checksum": "on",
                "compression": "off",
                "compressratio": "1.00x",
                "copies": "1",
                "creation": "Thu Jun 16 11:37 2016",
                "dedup": "off",
                "devices": "on",
                "exec": "on",
                "filesystem_count": "none",
                "filesystem_limit": "none",
                "logbias": "latency",
                "logicalreferenced": "18.5K",
                "logicalused": "3.45G",
                "mlslabel": "none",
                "mounted": "yes",
                "mountpoint": "/rpool",
                "name": "rpool",
                "nbmand": "off",
                "normalization": "none",
                "org.openindiana.caiman:install": "ready",
                "primarycache": "all",
                "quota": "none",
                "readonly": "off",
                "recordsize": "128K",
                "redundant_metadata": "all",
                "refcompressratio": "1.00x",
                "referenced": "29.5K",
                "refquota": "none",
                "refreservation": "none",
                "reservation": "none",
                "secondarycache": "all",
                "setuid": "on",
                "sharenfs": "off",
                "sharesmb": "off",
                "snapdir": "hidden",
                "snapshot_count": "none",
                "snapshot_limit": "none",
                "sync": "standard",
                "type": "filesystem",
                "used": "4.41G",
                "usedbychildren": "4.41G",
                "usedbydataset": "29.5K",
                "usedbyrefreservation": "0",
                "usedbysnapshots": "0",
                "utf8only": "off",
                "version": "5",
                "vscan": "off",
                "written": "29.5K",
                "xattr": "on",
                "zoned": "off"
            }
(tdefaultdict(t
AnsibleModule(t	iteritemstallt
filesystemtvolumetsnapshottbookmarktZFSFactscB`s#eZd�Zd�Zd�ZRS(cC`s�||_|jd|_|jd|_|jd|_|jd|_|jd|_|jd|_tt	�|_
g|_dS(Ntnametrecursetparsablet
propertiesttypetdepth(tmoduletparamsRRRRRRRtdictt	_datasetstfacts(tselfR((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pyt__init__�s	cC`se|jjd�g}|jd�|j|j�|jj|�\}}}|dkr]tStSdS(Ntzfstlisti(Rtget_bin_pathtappendRtrun_commandtTruetFalse(Rtcmdtrctoutterr((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pytdataset_exists�s
cC`s�|jjd�g}|jd�|jd�|jrH|jd�n|jra|jd�nt|j�dkr�|jd�|jd|j�n|jr�|jd	�|j|j�n|jd
�|jd�|j|j�|j|j	�|jj
|�\}}}|dkr�xG|j�D]9}|jd�\}}}|j
|ji||6�q1WxAt|j
�D]0\}	}
|
ji|	d
6�|jj|
�q~Wi|jd6S|jjdd|j	d|d|�dS(NRtgets-Hs-ps-ris-ds%ss-ts-osname,property,values	Rtansible_zfs_datasetstmsgs5Error while trying to get facts about ZFS dataset: %ststderrR&(RR R!RRtintRRRRR"t
splitlinestsplitRtupdateR
Rt	fail_json(RR%R&R'R(tlinetdatasettpropertytvaluetktv((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pyt	get_facts�s:

		
	


(t__name__t
__module__RR)R9(((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pyR�s		
cC`shtdtdtdtdddgdd�d	tdtd
tdd�dtdtd
tdd�d
tdtd
ddd�dtdtd
ddddt�dtdtd
ddd��dt�}t|�}i}t|d<|j|d<|jr|j|d<n|jr!|j|d	<n|j	�r@|j
�|d<n|jdd|j�|j|�dS(Nt
argument_specRtrequiredtaliasestdsR4RtstrRtdefaulttboolRRRtchoicesRiR.tsupports_check_modetchangedt
ansible_factsR,sZFS dataset %s does not exist!(
R	RR#R$tSUPPORTED_TYPESRRRRR)R9R2t	exit_json(Rt	zfs_factstresult((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pytmain�s*!!	

		t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtcollectionsRtansible.module_utils.basicR	tansible.module_utils.sixR
RGtobjectRRKR:(((sI/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zfs_facts.pyt<module>s


,QC	!

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]