ansible-collections/cisco.nxos

cisco.nxos.ntp_global vrf support for a server

nleiva opened this issue · 1 comments

SUMMARY

cisco.nxos.ntp_global errors when a vrf is passed as an argument for a server

ISSUE TYPE
  • Bug Report
COMPONENT NAME

cisco.nxos.ntp_global

ANSIBLE VERSION
any

COLLECTION VERSION
cisco.nxos

CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE

NTP config:

cfg:
  servers:
    - server: 132.163.97.5      
      vrf: default
      prefer: true

Task:

    - name: Use NTP resource module [Cisco NX-OS]
      cisco.nxos.ntp_global:
        state: merged
        config: "{{ cfg }}"
      when: ansible_network_os == 'nxos'
EXPECTED RESULTS
ACTUAL RESULTS
TASK [Use NTP resource module [Cisco NX-OS]] ***********************************************************************
task path: /home/nleiva/Ansible/ansible-network-demo/ntp.yml:13
Read vars_file 'ntp.cfg'
redirecting (type: action) cisco.nxos.ntp_global to cisco.nxos.nxos
skipping: [sandbox-iosxe-latest-1.cisco.com] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
Read vars_file 'ntp.cfg'
redirecting (type: action) cisco.nxos.ntp_global to cisco.nxos.nxos
skipping: [sandbox-iosxr-1.cisco.com] => {
    "changed": false,
    "skip_reason": "Conditional result was False"
}
redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<sandbox-nxos-1.cisco.com> attempting to start connection
<sandbox-nxos-1.cisco.com> using connection plugin ansible.netcommon.httpapi
Found ansible-connection at path /usr/bin/ansible-connection
<sandbox-nxos-1.cisco.com> local domain socket does not exist, starting it
<sandbox-nxos-1.cisco.com> control socket path is /home/runner/.ansible/pc/7f27b30385
<sandbox-nxos-1.cisco.com> redirecting (type: connection) ansible.builtin.httpapi to ansible.netcommon.httpapi
<sandbox-nxos-1.cisco.com> Loading collection ansible.netcommon from /usr/share/ansible/collections/ansible_collections/ansible/netcommon
<sandbox-nxos-1.cisco.com> redirecting (type: httpapi) ansible.builtin.nxos to cisco.nxos.nxos
<sandbox-nxos-1.cisco.com> Loading collection cisco.nxos from /usr/share/ansible/collections/ansible_collections/cisco/nxos
<sandbox-nxos-1.cisco.com> local domain socket listeners started successfully
<sandbox-nxos-1.cisco.com> loaded API plugin ansible_collections.cisco.nxos.plugins.httpapi.nxos from path /usr/share/ansible/collections/ansible_collections/cisco/nxos/plugins/httpapi/nxos.py for platform type nxos
<sandbox-nxos-1.cisco.com> 
<sandbox-nxos-1.cisco.com> local domain socket path is /home/runner/.ansible/pc/7f27b30385
redirecting (type: action) cisco.nxos.ntp_global to cisco.nxos.nxos
redirecting (type: action) cisco.nxos.ntp_global to cisco.nxos.nxos
<sandbox-nxos-1.cisco.com> ANSIBLE_NETWORK_IMPORT_MODULES: disabled
<sandbox-nxos-1.cisco.com> ANSIBLE_NETWORK_IMPORT_MODULES: module execution time may be extended
<sandbox-nxos-1.cisco.com> ESTABLISH LOCAL CONNECTION FOR USER: nleiva
<sandbox-nxos-1.cisco.com> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/runner/.ansible/tmp/ansible-local-25lnkccucu `"&& mkdir "` echo /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193 `" && echo ansible-tmp-1648669708.6068926-62-148611359072193="` echo /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193 `" ) && sleep 0'
redirecting (type: modules) cisco.nxos.ntp_global to cisco.nxos.nxos_ntp_global
Using module file /usr/share/ansible/collections/ansible_collections/cisco/nxos/plugins/modules/nxos_ntp_global.py
<sandbox-nxos-1.cisco.com> PUT /home/runner/.ansible/tmp/ansible-local-25lnkccucu/tmp80gqp1n6 TO /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193/AnsiballZ_nxos_ntp_global.py
<sandbox-nxos-1.cisco.com> EXEC /bin/sh -c 'chmod u+x /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193/ /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193/AnsiballZ_nxos_ntp_global.py && sleep 0'
<sandbox-nxos-1.cisco.com> EXEC /bin/sh -c '/usr/bin/python3.8 /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193/AnsiballZ_nxos_ntp_global.py && sleep 0'
<sandbox-nxos-1.cisco.com> EXEC /bin/sh -c 'rm -f -r /home/runner/.ansible/tmp/ansible-local-25lnkccucu/ansible-tmp-1648669708.6068926-62-148611359072193/ > /dev/null 2>&1 && sleep 0'
fatal: [sandbox-nxos-1.cisco.com]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "config": {
                "access_group": null,
                "allow": null,
                "authenticate": null,
                "authentication_keys": null,
                "logging": null,
                "master": null,
                "passive": null,
                "peers": null,
                "servers": [
                    {
                        "key_id": null,
                        "maxpoll": null,
                        "minpoll": null,
                        "prefer": true,
                        "server": "132.163.97.5",
                        "use_vrf": null,
                        "vrf": "default"
                    }
                ],
                "source": null,
                "source_interface": null,
                "trusted_keys": null
            },
            "running_config": null,
            "state": "merged"
        }
    },
    "msg": "Unsupported parameters for (cisco.nxos.ntp_global) module: config.servers.vrf. Supported parameters include: config, state, running_config."
}
Read vars_file 'ntp.cfg'

This has been fixed by #437.