{"action":"created","comment":{"url":"https://api.github.com/repos/ansible/ansible/pulls/comments/190340721","pull_request_review_id":122696542,"id":190340721,"diff_hunk":"@@ -0,0 +1,115 @@\n+#!/usr/bin/python\n+\n+# (c) 2018, NetApp, Inc\n+# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)\n+\n+from __future__ import absolute_import, division, print_function\n+__metaclass__ = type\n+\n+ANSIBLE_METADATA = {'metadata_version': '1.1',\n+                    'status': ['preview'],\n+                    'supported_by': 'community'}\n+\n+\n+DOCUMENTATION = '''\n+author: \"Suhas Bangalore Shekar (bsuhas@netapp.com), Archana Ganesan (garchana@netapp.com)\"\n+description:\n+  - \"Enable or disable HA on a cluster\"\n+extends_documentation_fragment:\n+  - netapp.na_ontap\n+module: na_ontap_cluster_ha\n+options:\n+  state:\n+    choices: ['present', 'absent']\n+    description:\n+      - \"Whether HA on cluster should be enabled or disabled.\"\n+    required: false\n+    default: present\n+short_description: \"Manage HA status for cluster\"\n+version_added: \"2.6\"\n+'''\n+\n+EXAMPLES = \"\"\"\n+    - name: \"Enable HA status for cluster\"\n+      na_ontap_cluster_ha:\n+        state: present\n+        hostname: \"{{ netapp_hostname }}\"\n+        username: \"{{ netapp_username }}\"\n+        password: \"{{ netapp_password }}\"\n+\"\"\"\n+\n+RETURN = \"\"\"\n+\"\"\"\n+\n+import traceback\n+from ansible.module_utils.basic import AnsibleModule\n+from ansible.module_utils._text import to_native\n+import ansible.module_utils.netapp as netapp_utils\n+HAS_NETAPP_LIB = netapp_utils.has_netapp_lib()\n+\n+\n+class NetAppOntapClusterHA(object):\n+    \"\"\"\n+    object initialize and class methods\n+    \"\"\"\n+    def __init__(self):\n+\n+        self.argument_spec = netapp_utils.na_ontap_host_argument_spec()\n+        self.argument_spec.update(dict(\n+            state=dict(required=False, choices=['present', 'absent'], default='present'),\n+        ))\n+        self.module = AnsibleModule(\n+            argument_spec=self.argument_spec,\n+            supports_check_mode=True\n+        )\n+        parameters = self.module.params\n+        # set up state variable\n+        self.state = parameters['state']\n+\n+        if HAS_NETAPP_LIB is False:\n+            self.module.fail_json(msg=\"the python NetApp-Lib module is required\")\n+        else:\n+            self.server = netapp_utils.setup_na_ontap_zapi(module=self.module)\n+\n+    def modify_cluster_ha(self, configure):\n+        \"\"\"\n+        Enable or disable HA on cluster\n+        \"\"\"\n+        cluster_ha_modify = netapp_utils.zapi.NaElement.create_node_with_children(\n+            'cluster-ha-modify', **{'ha-configured': configure})\n+        try:\n+            self.server.invoke_successfully(cluster_ha_modify,\n+                                            enable_tunneling=True)\n+        except netapp_utils.zapi.NaApiError as error:\n+            self.module.fail_json(msg='Error modifying cluster HA to %s: %s'\n+                                  % (configure, to_native(error)),\n+                                  exception=traceback.format_exc())\n+\n+    def apply(self):\n+        \"\"\"\n+        Apply action to cluster HA\n+        \"\"\"\n+        changed = False\n+        results = netapp_utils.get_cserver(self.server)\n+        cserver = netapp_utils.setup_na_ontap_zapi(module=self.module, vserver=results)\n+        netapp_utils.ems_log_event(\"na_ontap_cluster\", cserver)\n+        if self.state == 'present':","path":"lib/ansible/modules/storage/netapp/na_ontap_cluster_ha.py","position":96,"original_position":96,"commit_id":"dbbabd28e98745c18b1bbf5d4b6467a6fc84713d","original_commit_id":"02a86d23d02cd55b40563b0d5a60698a8657ddfa","user":{"login":"archanaganesan","id":6723017,"avatar_url":"https://avatars1.githubusercontent.com/u/6723017?v=4","gravatar_id":"","url":"https://api.github.com/users/archanaganesan","html_url":"https://github.com/archanaganesan","followers_url":"https://api.github.com/users/archanaganesan/followers","following_url":"https://api.github.com/users/archanaganesan/following{/other_user}","gists_url":"https://api.github.com/users/archanaganesan/gists{/gist_id}","starred_url":"https://api.github.com/users/archanaganesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/archanaganesan/subscriptions","organizations_url":"https://api.github.com/users/archanaganesan/orgs","repos_url":"https://api.github.com/users/archanaganesan/repos","events_url":"https://api.github.com/users/archanaganesan/events{/privacy}","received_events_url":"https://api.github.com/users/archanaganesan/received_events","type":"User","site_admin":false},"body":"The underlying API doesn't care about the existing state. It sets the state to the requested state (enabled or disabled)","created_at":"2018-05-23T17:48:20Z","updated_at":"2018-05-23T17:48:20Z","html_url":"https://github.com/ansible/ansible/pull/40487#discussion_r190340721","pull_request_url":"https://api.github.com/repos/ansible/ansible/pulls/40487","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments/190340721"},"html":{"href":"https://github.com/ansible/ansible/pull/40487#discussion_r190340721"},"pull_request":{"href":"https://api.github.com/repos/ansible/ansible/pulls/40487"}},"in_reply_to_id":190072676},"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/40487","id":189403473,"html_url":"https://github.com/ansible/ansible/pull/40487","diff_url":"https://github.com/ansible/ansible/pull/40487.diff","patch_url":"https://github.com/ansible/ansible/pull/40487.patch","issue_url":"https://api.github.com/repos/ansible/ansible/issues/40487","number":40487,"state":"open","locked":false,"title":"seconds set of netapp modules","user":{"login":"carchi8py","id":3905935,"avatar_url":"https://avatars1.githubusercontent.com/u/3905935?v=4","gravatar_id":"","url":"https://api.github.com/users/carchi8py","html_url":"https://github.com/carchi8py","followers_url":"https://api.github.com/users/carchi8py/followers","following_url":"https://api.github.com/users/carchi8py/following{/other_user}","gists_url":"https://api.github.com/users/carchi8py/gists{/gist_id}","starred_url":"https://api.github.com/users/carchi8py/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carchi8py/subscriptions","organizations_url":"https://api.github.com/users/carchi8py/orgs","repos_url":"https://api.github.com/users/carchi8py/repos","events_url":"https://api.github.com/users/carchi8py/events{/privacy}","received_events_url":"https://api.github.com/users/carchi8py/received_events","type":"User","site_admin":false},"body":"##### SUMMARY\r\nSecond set of 5\r\nWe are updating and adding the Netapp ONTAP specific modules. The update modules add new options for the existing functions. The new modules allow for setting up and modify different part of the ONTAP system.\r\n\r\nWe have about 33 modules, we've been told to start with 2 or 3 first, and take feedback on these first before pushing them all out\r\n\r\n##### ISSUE TYPE\r\n - New Module Pull Request\r\n\r\n##### COMPONENT NAME\r\n\tna_ontap_cluster.py\r\n\tna_ontap_cluster_ha.py\r\n\tna_ontap_export_policy.py\r\n\tna_ontap_export_policy_rule.py\r\n\tna_ontap_igroup.py\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nansible 2.6.0 (devel 0d1e9bfe90) last updated 2018/04/23 14:26:54 (GMT -400)\r\n  config file = None\r\n  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /tmp/ansible/lib/ansible\r\n  executable location = /tmp/ansible/bin/ansible\r\n  python version = 2.7.5 (default, Oct 11 2015, 17:47:16) [GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]\r\n\r\n```\r\n\r\n\r\n##### ADDITIONAL INFORMATION\r\n<!--- Include additional information to help people understand the change here.\r\nFor bugs that don't have a linked bug report, a step-by-step reproduction\r\nof the problem is helpful. -->\r\n\r\n<!--- Paste verbatim command output below, e.g. before and after your change -->\r\n```\r\n\r\n```\r\n","created_at":"2018-05-21T14:57:48Z","updated_at":"2018-05-23T17:48:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4cf4fca979e434df6c591304b2161030692a7a05","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":835286067,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.6","name":"affects_2.6","color":"ededed","default":false},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":61436281,"url":"https://api.github.com/repos/ansible/ansible/labels/needs_revision","name":"needs_revision","color":"eb6450","default":false},{"id":473225334,"url":"https://api.github.com/repos/ansible/ansible/labels/new_module","name":"new_module","color":"ededed","default":false},{"id":153577825,"url":"https://api.github.com/repos/ansible/ansible/labels/new_plugin","name":"new_plugin","color":"bfe5bf","default":false},{"id":636327968,"url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/ansible/pulls/40487/commits","review_comments_url":"https://api.github.com/repos/ansible/ansible/pulls/40487/comments","review_comment_url":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/40487/comments","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/dbbabd28e98745c18b1bbf5d4b6467a6fc84713d","head":{"label":"NetApp:ntap2","ref":"ntap2","sha":"dbbabd28e98745c18b1bbf5d4b6467a6fc84713d","user":{"login":"NetApp","id":370544,"avatar_url":"https://avatars0.githubusercontent.com/u/370544?v=4","gravatar_id":"","url":"https://api.github.com/users/NetApp","html_url":"https://github.com/NetApp","followers_url":"https://api.github.com/users/NetApp/followers","following_url":"https://api.github.com/users/NetApp/following{/other_user}","gists_url":"https://api.github.com/users/NetApp/gists{/gist_id}","starred_url":"https://api.github.com/users/NetApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetApp/subscriptions","organizations_url":"https://api.github.com/users/NetApp/orgs","repos_url":"https://api.github.com/users/NetApp/repos","events_url":"https://api.github.com/users/NetApp/events{/privacy}","received_events_url":"https://api.github.com/users/NetApp/received_events","type":"Organization","site_admin":false},"repo":{"id":132139777,"name":"ansible","full_name":"NetApp/ansible","owner":{"login":"NetApp","id":370544,"avatar_url":"https://avatars0.githubusercontent.com/u/370544?v=4","gravatar_id":"","url":"https://api.github.com/users/NetApp","html_url":"https://github.com/NetApp","followers_url":"https://api.github.com/users/NetApp/followers","following_url":"https://api.github.com/users/NetApp/following{/other_user}","gists_url":"https://api.github.com/users/NetApp/gists{/gist_id}","starred_url":"https://api.github.com/users/NetApp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetApp/subscriptions","organizations_url":"https://api.github.com/users/NetApp/orgs","repos_url":"https://api.github.com/users/NetApp/repos","events_url":"https://api.github.com/users/NetApp/events{/privacy}","received_events_url":"https://api.github.com/users/NetApp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NetApp/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com/ansible/","fork":true,"url":"https://api.github.com/repos/NetApp/ansible","forks_url":"https://api.github.com/repos/NetApp/ansible/forks","keys_url":"https://api.github.com/repos/NetApp/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NetApp/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NetApp/ansible/teams","hooks_url":"https://api.github.com/repos/NetApp/ansible/hooks","issue_events_url":"https://api.github.com/repos/NetApp/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/NetApp/ansible/events","assignees_url":"https://api.github.com/repos/NetApp/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/NetApp/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/NetApp/ansible/tags","blobs_url":"https://api.github.com/repos/NetApp/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NetApp/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NetApp/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/NetApp/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NetApp/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/NetApp/ansible/languages","stargazers_url":"https://api.github.com/repos/NetApp/ansible/stargazers","contributors_url":"https://api.github.com/repos/NetApp/ansible/contributors","subscribers_url":"https://api.github.com/repos/NetApp/ansible/subscribers","subscription_url":"https://api.github.com/repos/NetApp/ansible/subscription","commits_url":"https://api.github.com/repos/NetApp/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/NetApp/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/NetApp/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/NetApp/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/NetApp/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/NetApp/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NetApp/ansible/merges","archive_url":"https://api.github.com/repos/NetApp/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NetApp/ansible/downloads","issues_url":"https://api.github.com/repos/NetApp/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/NetApp/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/NetApp/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/NetApp/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NetApp/ansible/labels{/name}","releases_url":"https://api.github.com/repos/NetApp/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/NetApp/ansible/deployments","created_at":"2018-05-04T12:52:19Z","updated_at":"2018-05-21T14:49:48Z","pushed_at":"2018-05-23T17:02:17Z","git_url":"git://github.com/NetApp/ansible.git","ssh_url":"git@github.com:NetApp/ansible.git","clone_url":"https://github.com/NetApp/ansible.git","svn_url":"https://github.com/NetApp/ansible","homepage":"https://www.ansible.com/","size":115067,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"231c3586bd970d1bc086b361860d55085d8c0798","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":3638964,"name":"ansible","full_name":"ansible/ansible","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/ansible","description":"Ansible is a radically simple IT automation platform that makes your applications and systems easier to deploy. Avoid writing scripts or custom code to deploy and update your applications — automate in a language that approaches plain English, using SSH, with no agents to install on remote systems. https://docs.ansible.com/ansible/","fork":false,"url":"https://api.github.com/repos/ansible/ansible","forks_url":"https://api.github.com/repos/ansible/ansible/forks","keys_url":"https://api.github.com/repos/ansible/ansible/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/ansible/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/ansible/teams","hooks_url":"https://api.github.com/repos/ansible/ansible/hooks","issue_events_url":"https://api.github.com/repos/ansible/ansible/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/ansible/events","assignees_url":"https://api.github.com/repos/ansible/ansible/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/ansible/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/ansible/tags","blobs_url":"https://api.github.com/repos/ansible/ansible/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/ansible/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/ansible/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/ansible/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/ansible/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/ansible/languages","stargazers_url":"https://api.github.com/repos/ansible/ansible/stargazers","contributors_url":"https://api.github.com/repos/ansible/ansible/contributors","subscribers_url":"https://api.github.com/repos/ansible/ansible/subscribers","subscription_url":"https://api.github.com/repos/ansible/ansible/subscription","commits_url":"https://api.github.com/repos/ansible/ansible/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/ansible/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/ansible/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/ansible/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/ansible/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/ansible/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/ansible/merges","archive_url":"https://api.github.com/repos/ansible/ansible/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/ansible/downloads","issues_url":"https://api.github.com/repos/ansible/ansible/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/ansible/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/ansible/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/ansible/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/ansible/labels{/name}","releases_url":"https://api.github.com/repos/ansible/ansible/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/ansible/deployments","created_at":"2012-03-06T14:58:02Z","updated_at":"2018-05-23T17:31:41Z","pushed_at":"2018-05-23T17:45:10Z","git_url":"git://github.com/ansible/ansible.git","ssh_url":"git@github.com:ansible/ansible.git","clone_url":"https://github.com/ansible/ansible.git","svn_url":"https://github.com/ansible/ansible","homepage":"https://www.ansible.com/","size":123783,"stargazers_count":30374,"watchers_count":30374,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11375,"mirror_url":null,"archived":false,"open_issues_count":5112,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":11375,"open_issues":5112,"watchers":30374,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/ansible/pulls/40487"},"html":{"href":"https://github.com/ansible/ansible/pull/40487"},"issue":{"href":"https://api.github.com/repos/ansible/ansible/issues/40487"},"comments":{"href":"https://api.github.com/repos/ansible/ansible/issues/40487/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/ansible/pulls/40487/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/ansible/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/ansible/pulls/40487/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/ansible/statuses/dbbabd28e98745c18b1bbf5d4b6467a6fc84713d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"archanaganesan"}}