Configuring Switch which doesn't have python installed.

I am writing a custom module in python to configure a networking device(switch).If python is installed in the remote node then i can directly execute the script in the remote node and i have written the code accordingly.

I want to know how will i configure a device which doesn’t have python installed.Do i have to pass the parameters to the script through the YAML file and pass the host list which has to be configured also and then connect each host through the written logic in the module and configure the device?

Can someone please help me with the method?Also,if there is a sample script and play-book it will be greatly helpful.

Regards,
Churchill

If python is not installed on remote host which is the case for most network device you can use of network_cli [1] or netconf [2] or httapi [3] connection pluginbased on the device capabilities.

You can refer [4] for more details on module ↔ network_cli code flow.

[1] https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/network_cli.py
[2] https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/netconf.py
[3] https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/connection/httpapi.py
[4] https://groups.google.com/forum/#!topic/ansible-devel/qkDYC9MygGw

Hope this helps.

Regards,
Ganesh

Also refer https://groups.google.com/forum/#!topic/ansible-devel/TVe1HLYh4s8 for insights on developing module that works with network_cli connection plugin.

Regards,
Ganesh

Thanks a lot Ganesh for the valuable suggestion.Will explore this further.

Regards,
Churchill