Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new Pure Storage module to discover facts for FlashArray #37263

Merged
merged 1 commit into from
Apr 13, 2018

Conversation

sdodsley
Copy link
Contributor

@sdodsley sdodsley commented Mar 9, 2018

SUMMARY

Add new module to discover facts for a Pure Storage FlashArray.

Facts that can be discovered are:
- all
- minimum
- config
- performance
- capacity
- network
- subnet
- interfaces
- hgorups
- pgroups
- hosts
- volumes
- snapshots

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

module/storage/purestorage/purefa_facts

ANSIBLE VERSION
2.5
ADDITIONAL INFORMATION

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_module This PR includes a new module. new_plugin This PR includes a new plugin. performance support:community This issue/PR relates to code supported by the Ansible community. labels Mar 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Mar 9, 2018

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:324:13: E128 continuation line under-indented for visual indent

The test ansible-test sanity --test validate-modules [explain] failed with 2 errors:

lib/ansible/modules/storage/purestorage/purefa_facts.py:0:0: E324 Value for "default" from the argument_spec (['default']) for "gather_subset" does not match the documentation ('default')
lib/ansible/modules/storage/purestorage/purefa_facts.py:0:0: E326 Value for "choices" from the argument_spec ([]) for "gather_subset" does not match the documentation (['all', 'default', 'config', 'performance', 'capacity', 'network', 'subnet', 'interfaces', 'hgorups', 'pgroups', 'hosts', 'volumes', 'snapshots'])

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 9, 2018
@sdodsley sdodsley force-pushed the purefa_facts branch 2 times, most recently from a3c28a6 to 10568bf Compare March 9, 2018 22:29
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Mar 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Mar 9, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:0:0: E326 Value for "choices" from the argument_spec ([]) for "gather_subset" does not match the documentation (['all', 'minimum', 'config', 'performance', 'capacity', 'network', 'subnet', 'interfaces', 'hgorups', 'pgroups', 'hosts', 'volumes', 'snapshots'])

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Mar 9, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Mar 9, 2018
@ansibot
Copy link
Contributor

ansibot commented Mar 9, 2018

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:318:27: E124 closing bracket does not match visual indentation

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:0:0: E326 Value for "choices" from the argument_spec (['all', 'minimum', 'config', 'performance', 'capacity', 'network', 'subnet', 'interfaces', 'hgroups', 'pgroups', 'hosts', 'volumes', 'snapshots']) for "gather_subset" does not match the documentation (['all', 'minimum', 'config', 'performance', 'capacity', 'network', 'subnet', 'interfaces', 'hgorups', 'pgroups', 'hosts', 'volumes', 'snapshots'])

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Mar 9, 2018
@sdodsley sdodsley force-pushed the purefa_facts branch 3 times, most recently from 7505ff2 to b2431b5 Compare March 12, 2018 14:12
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 12, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 11, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:132:4: E313 RETURN is not valid YAML

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:132:4: error RETURN: syntax error: expected <block end>, but found '<block mapping start>'

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Apr 11, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Apr 11, 2018
@sdodsley sdodsley force-pushed the purefa_facts branch 2 times, most recently from 989f4f9 to 71bdb9b Compare April 11, 2018 03:11
@ansibot
Copy link
Contributor

ansibot commented Apr 11, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:0:0: E319 RETURN.ansible_facts.config: extra keys not allowed @ data['config']. Got {'directory_service': {'array_admin_group': None, 'base_dn': None, 'bind_password': None, 'bind_user': None, 'check_peer': False, 'enabled': False, 'group_base': None, 'readonly_group': None, 'storage_admin_group': None, 'uri': []}, 'dns': {'domain': 'domain.com', 'nameservers': ['8.8.8.8', '8.8.4.4']}, 'ntp': ['0.pool.ntp.org', '1.pool.ntp.org', '2.pool.ntp.org', '3.pool.ntp.org'], 'smtp': [{'enabled': True, 'name': 'alerts@domain.com'}, {'enabled': True, 'name': 'user@domain.com'}], 'snmp':...

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Apr 11, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Apr 11, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 12, 2018

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:272:161: E501 line too long (178 > 160 characters)

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:68:23: E313 RETURN is not valid YAML

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:68:23: error RETURN: syntax error: expected <block end>, but found ','

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Apr 12, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Apr 12, 2018
@ansibot
Copy link
Contributor

ansibot commented Apr 12, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:68:23: E313 RETURN is not valid YAML

The test ansible-test sanity --test yamllint [explain] failed with 1 error:

lib/ansible/modules/storage/purestorage/purefa_facts.py:68:23: error RETURN: syntax error: expected <block end>, but found ','

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Apr 12, 2018
@maxamillion
Copy link
Contributor

The string contained within RETURN must be valid yaml, so this is just a formatting issue.

Below is a patch to fix

diff --git a/lib/ansible/modules/storage/purestorage/purefa_facts.py b/lib/ansible/modules/storage/purestorage/purefa_facts.py
index 9229dc68c5..25baac1858 100644
--- a/lib/ansible/modules/storage/purestorage/purefa_facts.py
+++ b/lib/ansible/modules/storage/purestorage/purefa_facts.py
@@ -65,229 +65,229 @@ ansible_facts:
   returned: always
   type: complex
   contains:
-        "capacity": {},
-        "config": {
-            "directory_service": {
-                "array_admin_group": null,
-                "base_dn": null,
-                "bind_password": null,
-                "bind_user": null,
-                "check_peer": false,
-                "enabled": false,
-                "group_base": null,
-                "readonly_group": null,
-                "storage_admin_group": null,
-                "uri": []
-            },
-            "dns": {
-                "domain": "domain.com",
-                "nameservers": [
-                    "8.8.8.8",
-                    "8.8.4.4"
-                ]
-            },
-            "ntp": [
-                "0.ntp.pool.org",
-                "1.ntp.pool.org",
-                "2.ntp.pool.org",
-                "3.ntp.pool.org"
-            ],
-            "smtp": [
-                {
-                    "enabled": true,
-                    "name": "alerts@acme.com"
-                },
-                {
-                    "enabled": true,
-                    "name": "user@acme.com"
-                }
-            ],
-            "snmp": [
-                {
-                    "auth_passphrase": null,
-                    "auth_protocol": null,
-                    "community": null,
-                    "host": "localhost",
-                    "name": "localhost",
-                    "privacy_passphrase": null,
-                    "privacy_protocol": null,
-                    "user": null,
-                    "version": "v2c"
-                }
-            ],
-            "ssl_certs": {
-                "country": null,
-                "email": null,
-                "issued_by": "",
-                "issued_to": "",
-                "key_size": 2048,
-                "locality": null,
-                "organization": "Acme Storage, Inc.",
-                "organizational_unit": "Acme Storage, Inc.",
-                "state": null,
-                "status": "self-signed",
-                "valid_from": "2017-08-11T23:09:06Z",
-                "valid_to": "2027-08-09T23:09:06Z"
-            },
-            "syslog": []
+    "capacity": {}
+    "config": {
+      "directory_service": {
+        "array_admin_group": null,
+        "base_dn": null,
+        "bind_password": null,
+        "bind_user": null,
+        "check_peer": false,
+        "enabled": false,
+        "group_base": null,
+        "readonly_group": null,
+        "storage_admin_group": null,
+        "uri": []
+      },
+      "dns": {
+        "domain": "domain.com",
+        "nameservers": [
+          "8.8.8.8",
+          "8.8.4.4"
+        ]
+      },
+      "ntp": [
+        "0.ntp.pool.org",
+        "1.ntp.pool.org",
+        "2.ntp.pool.org",
+        "3.ntp.pool.org"
+      ],
+      "smtp": [
+        {
+          "enabled": true,
+          "name": "alerts@acme.com"
         },
-        "default": {
-            "array_name": "flasharray1",
-            "hostgroups": 0,
-            "hosts": 10,
-            "protection_groups": 1,
-            "purity_version": "5.0.4",
-            "snapshots": 1
-        },
-        "hgroups": {},
-        "hosts": {
-            "host1": {
-                "hgroup": null,
-                "iqn": [
-                    "iqn.1994-05.com.redhat:2f6f5715a533"
-                ],
-                "wwn": []
-            },
-            "host2": {
-                "hgroup": null,
-                "iqn": [
-                    "iqn.1994-05.com.redhat:d17fb13fe0b"
-                ],
-                "wwn": []
-            },
-            "host3": {
-                "hgroup": null,
-                "iqn": [
-                    "iqn.1994-05.com.redhat:97b1351bfb2"
-                ],
-                "wwn": []
-            },
-            "host4": {
-                "hgroup": null,
-                "iqn": [
-                    "iqn.1994-05.com.redhat:dd84e9a7b2cb"
-                ],
-                "wwn": [
-                    "10000000C96C48D1",
-                    "10000000C96C48D2"
-                ]
-            }
-        },
-        "interfaces": {
-            "CT0.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
-            "CT0.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
-            "CT1.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
-            "CT1.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682"
-        },
-        "network": {
-            "ct0.eth0": {
-                "address": "10.10.10.10",
-                "gateway": "10.10.10.1",
-                "hwaddr": "ec:f4:bb:c8:8a:04",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "management"
-                ],
-                "speed": 1000000000
-            },
-            "ct0.eth2": {
-                "address": "10.10.10.11",
-                "gateway": null,
-                "hwaddr": "ec:f4:bb:c8:8a:00",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "replication"
-                ],
-                "speed": 10000000000
-            },
-            "ct0.eth3": {
-                "address": "10.10.10.12",
-                "gateway": null,
-                "hwaddr": "ec:f4:bb:c8:8a:02",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "replication"
-                ],
-                "speed": 10000000000
-            },
-            "ct0.eth4": {
-                "address": "10.10.10.13",
-                "gateway": null,
-                "hwaddr": "90:e2:ba:83:79:0c",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "iscsi"
-                ],
-                "speed": 10000000000
-            },
-            "ct0.eth5": {
-                "address": "10.10.10.14",
-                "gateway": null,
-                "hwaddr": "90:e2:ba:83:79:0d",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "iscsi"
-                ],
-                "speed": 10000000000
-            },
-            "vir0": {
-                "address": "10.10.10.20",
-                "gateway": "10.10.10.1",
-                "hwaddr": "fe:ba:e9:e7:6b:0f",
-                "mtu": 1500,
-                "netmask": "255.255.255.0",
-                "services": [
-                    "management"
-                ],
-                "speed": 1000000000
-            }
-        },
-        "performance": {
-            "input_per_sec": 8191,
-            "output_per_sec": 0,
-            "queue_depth": 1,
-            "reads_per_sec": 0,
-            "san_usec_per_write_op": 15,
-            "usec_per_read_op": 0,
-            "usec_per_write_op": 642,
-            "writes_per_sec": 2
-        },
-        "pgroups": {
-            "consisgroup-07b6b983-986e-46f5-bdc3-deaa3dbb299e-cinder": {
-                "hgroups": null,
-                "hosts": null,
-                "source": "host1",
-                "targets": null,
-                "volumes": [
-                    "volume-1"
-                ]
-            }
-        },
-        "snapshots": {
-            "consisgroup.cgsnapshot": {
-                "created": "2018-03-28T09:34:02Z",
-                "size": 13958643712,
-                "source": "volume-1"
-            }
-        },
-        "subnet": {},
-        "volumes": {
-            "ansible_data": {
-                "hosts": [
-                    [
-                        "host1",
-                        1
-                    ]
-                ],
-                "serial": "43BE47C12334399B000114A6",
-                "size": 1099511627776
-            }
+        {
+          "enabled": true,
+          "name": "user@acme.com"
+        }
+      ],
+      "snmp": [
+        {
+          "auth_passphrase": null,
+          "auth_protocol": null,
+          "community": null,
+          "host": "localhost",
+          "name": "localhost",
+          "privacy_passphrase": null,
+          "privacy_protocol": null,
+          "user": null,
+          "version": "v2c"
         }
+      ],
+      "ssl_certs": {
+        "country": null,
+        "email": null,
+        "issued_by": "",
+        "issued_to": "",
+        "key_size": 2048,
+        "locality": null,
+        "organization": "Acme Storage, Inc.",
+        "organizational_unit": "Acme Storage, Inc.",
+        "state": null,
+        "status": "self-signed",
+        "valid_from": "2017-08-11T23:09:06Z",
+        "valid_to": "2027-08-09T23:09:06Z"
+      },
+      "syslog": []
+    }
+    "default": {
+      "array_name": "flasharray1",
+      "hostgroups": 0,
+      "hosts": 10,
+      "protection_groups": 1,
+      "purity_version": "5.0.4",
+      "snapshots": 1
+    }
+    "hgroups": {}
+    "hosts": {
+      "host1": {
+        "hgroup": null,
+        "iqn": [
+          "iqn.1994-05.com.redhat:2f6f5715a533"
+        ],
+        "wwn": []
+      },
+      "host2": {
+        "hgroup": null,
+        "iqn": [
+          "iqn.1994-05.com.redhat:d17fb13fe0b"
+        ],
+        "wwn": []
+      },
+      "host3": {
+        "hgroup": null,
+        "iqn": [
+          "iqn.1994-05.com.redhat:97b1351bfb2"
+        ],
+        "wwn": []
+      },
+      "host4": {
+        "hgroup": null,
+        "iqn": [
+          "iqn.1994-05.com.redhat:dd84e9a7b2cb"
+        ],
+        "wwn": [
+          "10000000C96C48D1",
+          "10000000C96C48D2"
+        ]
+      }
+    }
+    "interfaces": {
+      "CT0.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
+      "CT0.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
+      "CT1.ETH4": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682",
+      "CT1.ETH5": "iqn.2010-06.com.purestorage:flasharray.2111b767484e4682"
+    }
+    "network": {
+      "ct0.eth0": {
+        "address": "10.10.10.10",
+        "gateway": "10.10.10.1",
+        "hwaddr": "ec:f4:bb:c8:8a:04",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "management"
+        ],
+        "speed": 1000000000
+      },
+      "ct0.eth2": {
+        "address": "10.10.10.11",
+        "gateway": null,
+        "hwaddr": "ec:f4:bb:c8:8a:00",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "replication"
+        ],
+        "speed": 10000000000
+      },
+      "ct0.eth3": {
+        "address": "10.10.10.12",
+        "gateway": null,
+        "hwaddr": "ec:f4:bb:c8:8a:02",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "replication"
+        ],
+        "speed": 10000000000
+      },
+      "ct0.eth4": {
+        "address": "10.10.10.13",
+        "gateway": null,
+        "hwaddr": "90:e2:ba:83:79:0c",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "iscsi"
+        ],
+        "speed": 10000000000
+      },
+      "ct0.eth5": {
+        "address": "10.10.10.14",
+        "gateway": null,
+        "hwaddr": "90:e2:ba:83:79:0d",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "iscsi"
+        ],
+        "speed": 10000000000
+      },
+      "vir0": {
+        "address": "10.10.10.20",
+        "gateway": "10.10.10.1",
+        "hwaddr": "fe:ba:e9:e7:6b:0f",
+        "mtu": 1500,
+        "netmask": "255.255.255.0",
+        "services": [
+          "management"
+        ],
+        "speed": 1000000000
+      }
+    }
+    "performance": {
+      "input_per_sec": 8191,
+      "output_per_sec": 0,
+      "queue_depth": 1,
+      "reads_per_sec": 0,
+      "san_usec_per_write_op": 15,
+      "usec_per_read_op": 0,
+      "usec_per_write_op": 642,
+      "writes_per_sec": 2
+    }
+    "pgroups": {
+      "consisgroup-07b6b983-986e-46f5-bdc3-deaa3dbb299e-cinder": {
+        "hgroups": null,
+        "hosts": null,
+        "source": "host1",
+        "targets": null,
+        "volumes": [
+          "volume-1"
+        ]
+      }
+    }
+    "snapshots": {
+      "consisgroup.cgsnapshot": {
+        "created": "2018-03-28T09:34:02Z",
+        "size": 13958643712,
+        "source": "volume-1"
+      }
+    }
+    "subnet": {}
+    "volumes": {
+      "ansible_data": {
+        "hosts": [
+          [
+            "host1",
+            1
+          ]
+        ],
+        "serial": "43BE47C12334399B000114A6",
+        "size": 1099511627776
+      }
+    }
 '''
 
 

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Apr 12, 2018
@maxamillion maxamillion merged commit c5b3a5e into ansible:devel Apr 13, 2018
@sdodsley sdodsley deleted the purefa_facts branch April 13, 2018 23:07
ilicmilan pushed a commit to ilicmilan/ansible that referenced this pull request Nov 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. new_module This PR includes a new module. new_plugin This PR includes a new plugin. performance support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants