Repository: ansible/ansible

Issue:
aci_epg_to_domain Module - Typo in "resolution_immediacy" parameter verification
<!---
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release, and master branch are affected too.
-->

##### ISSUE TYPE
<!--- Pick one below and delete the rest: -->
 - Bug Report


##### COMPONENT NAME
<!--- Name of the module/plugin/task/feature -->
aci_epg_to_domain Module

##### ANSIBLE VERSION
<!--- Paste verbatim output from “ansible --version” between quotes below -->
```
ansible 2.4.0 (devel 60d0139844) last updated 2017/09/04 11:27:17 (GMT +200)
  config file = None
  configured module search path = [u'/home/dhamann/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/dhamann/ddsdnlab.at/ansible/lib/ansible
  executable location = /home/dhamann/ddsdnlab.at/ansible/bin/ansible
  python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]
```

##### CONFIGURATION
<!---
Mention any settings you have changed/added/removed in ansible.cfg
(or using the ANSIBLE_* environment variables).
-->
N/A

##### OS / ENVIRONMENT
<!---
Mention the OS you are running Ansible from, and the OS you are
managing, or say “N/A” for anything that is not platform-specific.
Also mention the specific version of what you are trying to control,
e.g. if this is a network bug the version of firmware on the network device.
-->
N/A

##### SUMMARY
<!--- Explain the problem briefly -->
Typo in "resolution_immediacy" parameter verification
##### STEPS TO REPRODUCE
<!---
For bugs, show exactly how to reproduce the problem, using a minimal test-case.
For new features, show how the feature would be used.
-->
Set resolution_immediacy to "immediate" in an "aci_epg_to_domain" task. You will get a verification error requiring you to set this parameter to "immdediate" (note: immDediate). Setting this parameter to immdediate will pass Ansible verification but of course fail with APIC.

<!--- Paste example playbooks or commands between quotes below -->
```yaml
  - name: Associate EPGs to VMM Domain
    tags:
      - create
      - network
    aci_epg_to_domain:
      host: "{{ apic_hostname }}"
      username: "{{ apic_username }}"
      password: "{{ apic_password }}"
      validate_certs: false
      tenant: SDNLAB
      ap: Demo_3Tier_App
      epg: "{{ item.epg }}"
      domain: "{{ item.domain}}"
      domain_type: vmm
      vm_provider: "{{ item.vm_provider}}"
      resolution_i
      state: present
    with_items:
      - epg: web
        domain: DVS1
        vm_provider: vmware
      - epg: database
        domain: DVS1
        vm_provider: vmware
```

<!--- You can also paste gist.github.com links for larger files -->

##### EXPECTED RESULTS
<!--- What did you expect to happen when running the steps above? -->
TAKS finishes ok

##### ACTUAL RESULTS
<!--- What actually happened? If possible run with extra verbosity (-vvvv) -->

<!--- Paste verbatim command output between quotes below -->
```
TASK [Associate EPGs to VMM Domain] ************************************************************************************************************************************************************************
task path: /home/user/lab/lab-ansible/3tierapp.yml:71
Using module file /home/user/lab/ansible/lib/ansible/modules/network/aci/aci_epg_to_domain.py
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: user
<localhost> EXEC /bin/sh -c 'echo ~ && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050 `" && echo ansible-tmp-1504609699.07-16249061805050="` echo /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050 `" ) && sleep 0'
<localhost> PUT /tmp/tmpMpfsid TO /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050/aci_epg_to_domain.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050/ /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050/aci_epg_to_domain.py && sleep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050/aci_epg_to_domain.py; rm -rf "/home/user/.ansible/tmp/ansible-tmp-1504609699.07-16249061805050/" > /dev/null 2>&1 && sleep 0'
failed: [localhost] (item={u'epg': u'web', u'domain': u'DVS1', u'vm_provider': u'vmware'}) => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "ap": "Demo_3Tier_App", 
            "domain": "DVS1", 
            "domain_type": "vmm", 
            "epg": "web", 
            "host": "apic.lab", 
            "hostname": "apic.lab", 
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER", 
            "resolution_immediacy": "immediate", 
            "state": "present", 
            "tenant": "SDNLAB", 
            "timeout": 30, 
            "use_proxy": true, 
            "use_ssl": true, 
            "username": "ansible", 
            "validate_certs": false, 
            "vm_provider": "vmware"
        }
    }, 
    "item": {
        "domain": "DVS1", 
        "epg": "web", 
        "vm_provider": "vmware"
    }, 
    "msg": "value of resolution_immediacy must be one of: immdediate,lazy,pre-provision, got: immediate"
}

```



Discussion:
cc @dagwieers @jmcgill298 @schunduri
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->
cc @dagwieers @jmcgill298 @schunduri
[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/lib/ansible/modules/network/aci/aci_epg_to_domain.py b/lib/ansible/modules/network/aci/aci_epg_to_domain.py
--- a/lib/ansible/modules/network/aci/aci_epg_to_domain.py
+++ b/lib/ansible/modules/network/aci/aci_epg_to_domain.py
@@ -121,7 +121,7 @@ def main():
         epg=dict(type='str', aliases=['name', 'epg_name']),
         netflow=dict(type='str', choices=['disabled', 'enabled']),
         primary_encap=dict(type='int'),
-        resolution_immediacy=dict(type='str', choices=['immdediate', 'lazy', 'pre-provision']),
+        resolution_immediacy=dict(type='str', choices=['immediate', 'lazy', 'pre-provision']),
         state=dict(type='str', default='present', choices=['absent', 'present', 'query']),
         tenant=dict(type='str', aliases=['tenant_name']),
         vm_provider=dict(type='str', choices=['vmware']),  # TODO: Find out OVS and Hyper-V options


Test patch: