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/zpool_facts.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys)
---
module: zpool_facts
short_description: Gather facts about ZFS pools.
description:
  - Gather facts from ZFS pool properties.
version_added: "2.3"
author: Adam Števko (@xen0l)
options:
    name:
        description:
            - ZFS pool name.
        aliases: [ "pool", "zpool" ]
        required: false
    parsable:
        description:
            - Specifies if property values should be displayed in machine
              friendly format.
        type: bool
        default: False
        required: false
    properties:
        description:
            - Specifies which dataset properties should be queried in comma-separated format.
              For more information about dataset properties, check zpool(1M) man page.
        aliases: [ "props" ]
        default: all
        required: false
s 
# Gather facts about ZFS pool rpool
- zpool_facts: pool=rpool

# Gather space usage about all imported ZFS pools
- zpool_facts: properties='free,size'

- debug: msg='ZFS pool {{ item.name }} has {{ item.free }} free space out of {{ item.size }}.'
  with_items: '{{ ansible_zfs_pools }}'
sK	
ansible_facts:
    description: Dictionary containing all the detailed information about the ZFS pool facts
    returned: always
    type: complex
    contains:
        ansible_zfs_pools:
            description: ZFS pool facts
            returned: always
            type: str
            sample:
                {
                    "allocated": "3.46G",
                    "altroot": "-",
                    "autoexpand": "off",
                    "autoreplace": "off",
                    "bootfs": "rpool/ROOT/openindiana",
                    "cachefile": "-",
                    "capacity": "6%",
                    "comment": "-",
                    "dedupditto": "0",
                    "dedupratio": "1.00x",
                    "delegation": "on",
                    "expandsize": "-",
                    "failmode": "wait",
                    "feature@async_destroy": "enabled",
                    "feature@bookmarks": "enabled",
                    "feature@edonr": "enabled",
                    "feature@embedded_data": "active",
                    "feature@empty_bpobj": "active",
                    "feature@enabled_txg": "active",
                    "feature@extensible_dataset": "enabled",
                    "feature@filesystem_limits": "enabled",
                    "feature@hole_birth": "active",
                    "feature@large_blocks": "enabled",
                    "feature@lz4_compress": "active",
                    "feature@multi_vdev_crash_dump": "enabled",
                    "feature@sha512": "enabled",
                    "feature@skein": "enabled",
                    "feature@spacemap_histogram": "active",
                    "fragmentation": "3%",
                    "free": "46.3G",
                    "freeing": "0",
                    "guid": "15729052870819522408",
                    "health": "ONLINE",
                    "leaked": "0",
                    "listsnapshots": "off",
                    "name": "rpool",
                    "readonly": "off",
                    "size": "49.8G",
                    "version": "-"
                }
name:
    description: ZFS pool name
    returned: always
    type: str
    sample: rpool
parsable:
    description: if parsable output should be provided in machine friendly format.
    returned: if 'parsable' is set to True
    type: bool
    sample: True
(tdefaultdict(t	iteritems(t
AnsibleModulet
ZPoolFactscB`s#eZd�Zd�Zd�ZRS(cC`sU||_|jd|_|jd|_|jd|_tt�|_g|_dS(Ntnametparsablet
properties(	tmoduletparamsRR
RRtdictt_poolstfacts(tselfR((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pyt__init__�s	cC`se|jjd�g}|jd�|j|j�|jj|�\}}}|dkr]tStSdS(Ntzpooltlisti(Rtget_bin_pathtappendRtrun_commandtTruetFalse(Rtcmdtrctoutterr((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pytpool_exists�s
cC`s{|jjd�g}|jd�|jd�|jrH|jd�n|jd�|jd�|j|j�|jr�|j|j�n|jj|�\}}}|dkrQxG|j�D]9}|jd�\}}}|j	|j
i||6�q�WxAt|j	�D]0\}	}
|
j
i|	d	6�|jj|
�qWi|jd
6S|jj
dd|jd
|d|�dS(NRtgets-Hs-ps-osname,property,valueis	Rtansible_zfs_poolstmsgs2Error while trying to get facts about ZFS pool: %ststderrR(RRRR
RRRt
splitlinestsplitRtupdateR	Rt	fail_json(RRRRR tlinetpooltpropertytvaluetktv((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pyt	get_facts�s,

	

	(t__name__t
__module__RR!R0(((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pyRs		
cC`stdtdtdtdddgdd�d	tdtd
tdd�dtdtd
d
dd��dt�}t|�}i}t|d<|j|d<|jr�|j|d	<n|jdk	r�|j�r�|j	�|d<q	|j
dd|j�n|j	�|d<|j|�dS(Nt
argument_specRtrequiredtaliasesR+RttypetstrR
tdefaulttboolRtalltsupports_check_modetchangedt
ansible_factsR$sZFS pool %s does not exist!(R
RRRRRR
tNoneR!R0R)t	exit_json(Rtzpool_factstresult((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pytmain�s$!	

	t__main__N(t
__future__RRRR6t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtcollectionsRtansible.module_utils.sixR	tansible.module_utils.basicR
tobjectRRBR1(((sK/usr/lib/python2.7/site-packages/ansible/modules/storage/zfs/zpool_facts.pyt<module>s


@9	

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