community.general/lib/ansible/modules/extras
Joseph Callen 773db55233 Resolves issue with vmware_migrate_vmk module for v2.0
When this module was written back in May 2015 we were using 1.9.x. Being lazy I added to param the objects that the other functions would need. What I have noticed is in 2.0 exit_json is trying to jsonify those complex objects and failing. This PR resolves that issue with the vmware_migrate_vmk module.

@kamsz reported this issue in https://github.com/ansible/ansible-modules-extras/pull/1568

Playbook
```
- name: Migrate Management vmk
      local_action:
        module: vmware_migrate_vmk
        hostname: "{{ mgmt_ip_address }}"
        username: "{{ vcsa_user }}"
        password: "{{ vcsa_pass }}"
        esxi_hostname: "{{ hostvars[item].hostname }}"
        device: vmk1
        current_switch_name: temp_vswitch
        current_portgroup_name: esx-mgmt
        migrate_switch_name: dvSwitch
        migrate_portgroup_name: Management
      with_items: groups['foundation_esxi']
```

Module Testing
```
TASK [Migrate Management vmk] **************************************************
task path: /opt/autodeploy/projects/emmet/tasks/deploy/migrate_vmk.yml:3
ESTABLISH LOCAL CONNECTION FOR USER: root
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695485.85-245405603184252 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695485.85-245405603184252 )" )
localhost PUT /tmp/tmpdlhr6t TO /root/.ansible/tmp/ansible-tmp-1454695485.85-245405603184252/vmware_migrate_vmk
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454695485.85-245405603184252/vmware_migrate_vmk; rm -rf "/root/.ansible/tmp/ansible-tmp-1454695485.85-245405603184252/" > /dev/null 2>&1
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695490.35-143738865490168 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695490.35-143738865490168 )" )
localhost PUT /tmp/tmpqfZqh1 TO /root/.ansible/tmp/ansible-tmp-1454695490.35-143738865490168/vmware_migrate_vmk
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454695490.35-143738865490168/vmware_migrate_vmk; rm -rf "/root/.ansible/tmp/ansible-tmp-1454695490.35-143738865490168/" > /dev/null 2>&1
localhost EXEC ( umask 22 && mkdir -p "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695491.96-124154332968882 )" && echo "$( echo $HOME/.ansible/tmp/ansible-tmp-1454695491.96-124154332968882 )" )
localhost PUT /tmp/tmpf3rKZq TO /root/.ansible/tmp/ansible-tmp-1454695491.96-124154332968882/vmware_migrate_vmk
localhost EXEC LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /root/.ansible/tmp/ansible-tmp-1454695491.96-124154332968882/vmware_migrate_vmk; rm -rf "/root/.ansible/tmp/ansible-tmp-1454695491.96-124154332968882/" > /dev/null 2>&1
ok: [foundation-vcsa -> localhost] => (item=foundation-esxi-01) => {"changed": false, "invocation": {"module_args": {"current_portgroup_name": "esx-mgmt", "current_switch_name": "temp_vswitch", "device": "vmk1", "esxi_hostname": "cscesxtmp001", "hostname": "172.27.0.100", "migrate_portgroup_name": "Management", "migrate_switch_name": "dvSwitch", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "username": "root"}, "module_name": "vmware_migrate_vmk"}, "item": "foundation-esxi-01"}
ok: [foundation-vcsa -> localhost] => (item=foundation-esxi-02) => {"changed": false, "invocation": {"module_args": {"current_portgroup_name": "esx-mgmt", "current_switch_name": "temp_vswitch", "device": "vmk1", "esxi_hostname": "cscesxtmp002", "hostname": "172.27.0.100", "migrate_portgroup_name": "Management", "migrate_switch_name": "dvSwitch", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "username": "root"}, "module_name": "vmware_migrate_vmk"}, "item": "foundation-esxi-02"}
ok: [foundation-vcsa -> localhost] => (item=foundation-esxi-03) => {"changed": false, "invocation": {"module_args": {"current_portgroup_name": "esx-mgmt", "current_switch_name": "temp_vswitch", "device": "vmk1", "esxi_hostname": "cscesxtmp003", "hostname": "172.27.0.100", "migrate_portgroup_name": "Management", "migrate_switch_name": "dvSwitch", "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", "username": "root"}, "module_name": "vmware_migrate_vmk"}, "item": "foundation-esxi-03"}
```
2016-12-08 11:33:53 -05:00
..
cloud Resolves issue with vmware_migrate_vmk module for v2.0 2016-12-08 11:33:53 -05:00
clustering Update for modules which import json. 2016-12-08 11:33:44 -05:00
commands Add functionality to give multiple iterative responses for a question in expect 2016-12-08 11:33:45 -05:00
database Updated database/misc/mongodb_user.py, the docs now explain how to add a read user to the local/oplog db 2016-12-08 11:33:51 -05:00
files added docs to blockinfile with_ interactions 2016-12-08 11:33:50 -05:00
messaging Issue #1668: rabbitmq_user: Ansible HEAD incorrectly treats permissions as a string instead of a list 2016-12-08 11:33:49 -05:00
monitoring return as unchanged if macro update is unnecessary 2016-12-08 11:33:52 -05:00
network Fix typo 2016-12-08 11:33:50 -05:00
notification U() markings in pushover docs should remain but need to be uppercased. 2016-12-08 11:33:49 -05:00
packaging Fix recurse delete. Add force update_cache feature. 2016-12-08 11:33:52 -05:00
source_control Update for modules which import json. 2016-12-08 11:33:44 -05:00
system The size option is required for lvol module with state=present 2016-12-08 11:33:50 -05:00
web_infrastructure Trick ansible-modules-validate to pass this with no RETURN. 2016-12-08 11:33:44 -05:00
windows Converting result to snake_case before returning 2016-12-08 11:33:52 -05:00
.travis.yml Don't call sys.exit in sns_topic, use HAS_BOTO to fail 2016-12-08 11:33:51 -05:00
__init__.py package files 2016-12-08 11:32:18 -05:00
CONTRIBUTING.md now point to local template 2016-12-08 11:33:50 -05:00
COPYING Copying snapshot of extras modules 2016-12-08 11:32:07 -05:00
ISSUE_TEMPLATE.md initial addition of issue/pr temlpates 2016-12-08 11:33:50 -05:00
PULL_REQUEST_TEMPLATE.md initial addition of issue/pr temlpates 2016-12-08 11:33:50 -05:00
README.md added installation info .. that you don't need to 2016-12-08 11:32:28 -05:00
REVIEWERS.md Add new SMEs for Zabbix 2016-12-08 11:33:33 -05:00
test-docs.sh Add testing documentation to travis 2016-12-08 11:32:55 -05:00
VERSION Version bump for new beta 2.0.0-0.5.beta3 2016-12-08 11:33:34 -05:00

ansible-modules-core

This repo is transitional and not yet enabled. Do not send issues or pull requests here yet.

The goal is to split library/ from ansible into git submodules.

Reporting bugs

Take care to submit tickets to the appropriate repo where modules are contained. The repo is mentioned at the bottom of modlue documentation page at docs.ansible.com.

Testing modules

Ansible module development guide contains the latest info about that.

License

As with Ansible, modules distributed with Ansible are GPLv3 licensed. User generated modules not part of this project can be of any license.

Installation

There should be no need to install this repo separately as it should be included in any Ansible install using the official documented methods.