�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d
Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont
deprecatedt statust communityt supported_bys
---
module: purefb_facts
version_added: '2.7'
deprecated:
removed_in: '2.13'
why: Deprecated in favor of C(_info) module.
alternative: Use M(purefb_info) instead.
short_description: Collect facts from Pure Storage FlashBlade
description:
- Collect facts information from a Pure Storage FlashBlade running the
Purity//FB operating system. By default, the module will collect basic
fact information including hosts, host groups, protection
groups and volume counts. Additional fact information can be collected
based on the configured set of arguments.
author:
- Pure Storage Ansible Team (@sdodsley) <[email protected]>
options:
gather_subset:
description:
- When supplied, this argument will define the facts to be collected.
Possible values for this include all, minimum, config, performance,
capacity, network, subnets, lags, filesystems and snapshots.
required: false
type: list
default: minimum
extends_documentation_fragment:
- purestorage.fb
s�
- name: collect default set of facts
purefb_facts:
fb_url: 10.10.10.2
api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
- name: collect configuration and capacity facts
purefb_facts:
gather_subset:
- config
- capacity
fb_url: 10.10.10.2
api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
- name: collect all facts
purefb_facts:
gather_subset:
- all
fb_url: 10.10.10.2
api_token: T-55a68eb5-c785-4720-a2ca-8b03903bf641
s�$
ansible_facts:
description: Returns the facts collected from the FlashBlade
returned: always
type: complex
sample: {
"capacity": {
"aggregate": {
"data_reduction": 1.1179228,
"snapshots": 0,
"total_physical": 17519748439,
"unique": 17519748439,
"virtual": 19585726464
},
"file-system": {
"data_reduction": 1.3642412,
"snapshots": 0,
"total_physical": 4748219708,
"unique": 4748219708,
"virtual": 6477716992
},
"object-store": {
"data_reduction": 1.0263462,
"snapshots": 0,
"total_physical": 12771528731,
"unique": 12771528731,
"virtual": 6477716992
},
"total": 83359896948925
},
"config": {
"alert_watchers": {
"enabled": true,
"name": "[email protected]"
},
"array_management": {
"base_dn": null,
"bind_password": null,
"bind_user": null,
"enabled": false,
"name": "management",
"services": [
"management"
],
"uris": []
},
"directory_service_roles": {
"array_admin": {
"group": null,
"group_base": null
},
"ops_admin": {
"group": null,
"group_base": null
},
"readonly": {
"group": null,
"group_base": null
},
"storage_admin": {
"group": null,
"group_base": null
}
},
"dns": {
"domain": "demo.acmestorage.com",
"name": "demo-fb-1",
"nameservers": [
"8.8.8.8"
],
"search": [
"demo.acmestorage.com"
]
},
"nfs_directory_service": {
"base_dn": null,
"bind_password": null,
"bind_user": null,
"enabled": false,
"name": "nfs",
"services": [
"nfs"
],
"uris": []
},
"ntp": [
"0.ntp.pool.org"
],
"smb_directory_service": {
"base_dn": null,
"bind_password": null,
"bind_user": null,
"enabled": false,
"name": "smb",
"services": [
"smb"
],
"uris": []
},
"smtp": {
"name": "demo-fb-1",
"relay_host": null,
"sender_domain": "acmestorage.com"
},
"ssl_certs": {
"certificate": "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----",
"common_name": "Acme Storage",
"country": "US",
"email": null,
"intermediate_certificate": null,
"issued_by": "Acme Storage",
"issued_to": "Acme Storage",
"key_size": 4096,
"locality": null,
"name": "global",
"organization": "Acme Storage",
"organizational_unit": "Acme Storage",
"passphrase": null,
"private_key": null,
"state": null,
"status": "self-signed",
"valid_from": "1508433967000",
"valid_to": "2458833967000"
}
},
"default": {
"blades": 15,
"buckets": 7,
"filesystems": 2,
"flashblade_name": "demo-fb-1",
"object_store_accounts": 1,
"object_store_users": 1,
"purity_version": "2.2.0",
"snapshots": 1,
"total_capacity": 83359896948925
},
"filesystems": {
"k8s-pvc-d24b1357-579e-11e8-811f-ecf4bbc88f54": {
"destroyed": false,
"fast_remove": false,
"hard_limit": true,
"nfs_rules": "*(rw,no_root_squash)",
"provisioned": 21474836480,
"snapshot_enabled": false
},
"z": {
"destroyed": false,
"fast_remove": false,
"hard_limit": false,
"provisioned": 1073741824,
"snapshot_enabled": false
}
},
"lag": {
"uplink": {
"lag_speed": 0,
"port_speed": 40000000000,
"ports": [
{
"name": "CH1.FM1.ETH1.1"
},
{
"name": "CH1.FM1.ETH1.2"
},
],
"status": "healthy"
}
},
"network": {
"fm1.admin0": {
"address": "10.10.100.6",
"gateway": "10.10.100.1",
"mtu": 1500,
"netmask": "255.255.255.0",
"services": [
"support"
],
"type": "vip",
"vlan": 2200
},
"fm2.admin0": {
"address": "10.10.100.7",
"gateway": "10.10.100.1",
"mtu": 1500,
"netmask": "255.255.255.0",
"services": [
"support"
],
"type": "vip",
"vlan": 2200
},
"nfs1": {
"address": "10.10.100.4",
"gateway": "10.10.100.1",
"mtu": 1500,
"netmask": "255.255.255.0",
"services": [
"data"
],
"type": "vip",
"vlan": 2200
},
"vir0": {
"address": "10.10.100.5",
"gateway": "10.10.100.1",
"mtu": 1500,
"netmask": "255.255.255.0",
"services": [
"management"
],
"type": "vip",
"vlan": 2200
}
},
"performance": {
"aggregate": {
"bytes_per_op": 0,
"bytes_per_read": 0,
"bytes_per_write": 0,
"read_bytes_per_sec": 0,
"reads_per_sec": 0,
"usec_per_other_op": 0,
"usec_per_read_op": 0,
"usec_per_write_op": 0,
"write_bytes_per_sec": 0,
"writes_per_sec": 0
},
"http": {
"bytes_per_op": 0,
"bytes_per_read": 0,
"bytes_per_write": 0,
"read_bytes_per_sec": 0,
"reads_per_sec": 0,
"usec_per_other_op": 0,
"usec_per_read_op": 0,
"usec_per_write_op": 0,
"write_bytes_per_sec": 0,
"writes_per_sec": 0
},
"nfs": {
"bytes_per_op": 0,
"bytes_per_read": 0,
"bytes_per_write": 0,
"read_bytes_per_sec": 0,
"reads_per_sec": 0,
"usec_per_other_op": 0,
"usec_per_read_op": 0,
"usec_per_write_op": 0,
"write_bytes_per_sec": 0,
"writes_per_sec": 0
},
"s3": {
"bytes_per_op": 0,
"bytes_per_read": 0,
"bytes_per_write": 0,
"read_bytes_per_sec": 0,
"reads_per_sec": 0,
"usec_per_other_op": 0,
"usec_per_read_op": 0,
"usec_per_write_op": 0,
"write_bytes_per_sec": 0,
"writes_per_sec": 0
}
},
"snapshots": {
"z.188": {
"destroyed": false,
"source": "z",
"source_destroyed": false,
"suffix": "188"
}
},
"subnet": {
"new-mgmt": {
"gateway": "10.10.100.1",
"interfaces": [
{
"name": "fm1.admin0"
},
{
"name": "fm2.admin0"
},
{
"name": "nfs1"
},
{
"name": "vir0"
}
],
"lag": "uplink",
"mtu": 1500,
"prefix": "10.10.100.0/24",
"services": [
"data",
"management",
"support"
],
"vlan": 2200
}
}
}
( t
AnsibleModule( t get_bladet purefb_argument_specs 1.3s 1.4c C` s� i } | j j � j d } | j | d <| j | d <t | j j � j � | d <t | j j � j � | d <t | j
j � j � | d <t | j j
� j � | d <t | j j � j � | d <t | j j � j � | d <| j j � j d j | d
<| S( Ni t flashblade_namet purity_versiont filesystemst snapshotst bucketst object_store_userst object_store_accountst bladest total_capacity( t arrayst list_arrayst itemst namet versiont lent file_systemst list_file_systemst file_system_snapshotst list_file_system_snapshotsR t list_bucketsR t list_object_store_usersR t list_object_store_accountst bladet list_bladest list_arrays_spacet capacity( R! t
default_factst defaults( ( sU /usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pyt generate_default_dict{ s
c C` s( i } | j j � } | j j d d � } | j j d d � } | j j d d � } i
| j d j d 6| j d j d 6| j d j d 6| j d j d 6| j d j d
6| j d j d 6| j d j d 6| j d j
d
6| j d j d 6| j d j d 6| d <i
| j d j d 6| j d j d 6| j d j d 6| j d j d 6| j d j d
6| j d j d 6| j d j d 6| j d j
d
6| j d j d 6| j d j d 6| d <i
| j d j d 6| j d j d 6| j d j d 6| j d j d 6| j d j d
6| j d j d 6| j d j d 6| j d j
d
6| j d j d 6| j d j d 6| d <i
| j d j d 6| j d j d 6| j d j d 6| j d j d 6| j d j d
6| j d j d 6| j d j d 6| j d j
d
6| j d j d 6| j d j d 6| d <| S( Nt protocolt httpt s3t nfsi t bytes_per_opt bytes_per_readt bytes_per_writet read_bytes_per_sect
reads_per_sect usec_per_other_opt usec_per_read_opt usec_per_write_opt write_bytes_per_sect writes_per_sect aggregate(
R t list_arrays_performanceR R, R- R. R/ R0 R1 R2 R3 R4 R5 ( R! t
perf_factst
total_perft http_perft s3_perft nfs_perf( ( sU /usr/lib/python2.7/site-packages/ansible/modules/storage/purestorage/_purefb_facts.pyt generate_perf_dict� sd c C` s� i } | j j � j d j � | d <| j j � j d j � | d <| j j � j d j � | d <| j j � j
} t | k r,| j j
d d g � j d j � | d <i | d <| j j � } xc t d t | j � � D]F } | j | j } i | j | j d 6| j | j d
6| d | <q� Wn | j j
d d g � j d j � | d <| j j
d d
g � j d j � | d <| j j � j d j | d <| j j � j d j � | d <| S( Ni t dnst smtpt alert_watcherst namest
managementt array_managementt directory_service_rolest groupt
group_baseR+ t nfs_directory_servicet smbt smb_directory_servicet ntpt ssl_certs( R>