Posted on July 22, 2019 5:29 pm
 |  Asked by Philippe Faucheux
 |  114 views
Tags:
RESOLVED
0
0
Print Friendly, PDF & Email

Hello all,

I have some difficulties to configure the cv_server_provision module on Ansible.
Does anyone have an idea of how we configure or find the switch_port information ?
I can’t match with the “switch_port” because my entered value is not configurable
“fatal: [13.50.48.1]: FAILED! => {“ansible_facts”: {“discovered_interpreter_python”: “/usr/bin/python”}, “changed”: false, “msg”: “Switch eos_switch_1 has no configurable server ports.”}”

Here the example taken :
- name: Get current configuration for interface Ethernet2
cv_server_provision:
host: cvp_node
username: cvp_user
password: cvp_pass
protocol: https
server_name: new_server
switch_name: eos_switch_1
switch_port: 2
template: template_file.j2
action: show

———————————
The official Ansible link here :
https://docs.ansible.com/ansible/latest/modules/cv_server_provision_module.html

If you have already test this module, any additional informations interests me.

Thanks,

1
Posted by Hugh
Answered on July 22, 2019 6:03 pm

Hi Philippe,

Have you been able to look at the examples in this EOS Central article?
https://eos.arista.com/export-cvp-functionality-ansible/

Taking your example I would expect it to look like:

– name: Get current configuration for interface Ethernet2
gather_facts: True
connection: local
host: {{IP address or URL of CVP Server}}
tasks:
– name: Provision Server
cv_server_provision:
host: cvp_node
username: cvp_user
password: cvp_pass
protocol: https
server_name: new_server
switch_name: eos_switch_1
switch_port: 2
template: template_file.j2
action: show

the switch port must be configured in a configlet that ends in -server if the configlet is not in CVP the module will fail. The article above has a good example in it.

I hope this helps :-)

Post your Answer

You must be logged in to post an answer.