ansible-network / cisco_nxos Goto Github PK
View Code? Open in Web Editor NEWAnsible Network Cisco NX-OS Provider Role
License: GNU General Public License v3.0
Ansible Network Cisco NX-OS Provider Role
License: GNU General Public License v3.0
Hello,
I try to create a task / playbook to deploy a vlan on a switch but some command stops me the execution of the task while that the output of the command is good.
Do you have an idea ?
`
ansible-playbook -i hosts.yml tasks/add_vlan_nexus.yml -e 'id_vlan="242"' -e 'name_vlan="test"' --verbose`
error:
`fatal: [NEXUS2]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "show vlan id 242\r\r\nVLAN 242 not found in current VLAN database\r\n\rswitch# "}
The output with the cli of the switch :
Is a normal output not en error beacause the vlan don't exist
Thank'you
The required fact nxos_config_checkpoint_filename
is not defined.
The following code block expects nxos_config_checkpoint_filename
to be defined.
https://github.com/ansible-network/cisco_nxos/blob/devel/includes/checkpoint/create.yaml#L13-L16
The nxos_checkpoint_filename
fact is defined code block - but not reused in this repository.
https://github.com/ansible-network/cisco_nxos/blob/devel/tasks/config_manager/load.yaml#L49-L56
TASK [ansible-network.cisco_nxos : remove old checkpoint file from device] ******************************************************************************************************************
task path: /home/vagrant/.ansible/roles/ansible-network.cisco_nxos/includes/checkpoint/create.yaml:13
fatal: [REDACTED]: FAILED! => {
"msg": "The conditional check 'nxos_config_checkpoint_filename in nxos_dir_listing.stdout' failed. The error was: error while evaluating conditional (nxos_config_checkpoint_filename in nxos_dir_listing.stdout): Unable to look up a name or access an attribute in template string ({% if nxos_config_checkpoint_filename in nxos_dir_listing.stdout %} True {% else %} False {% endif %}).\nMake sure your variable name does not contain invalid characters like '-': coercing to Unicode: need string or buffer, AnsibleUndefined found\n\nThe error appears to be in '/home/vagrant/.ansible/roles/ansible-network.cisco_nxos/includes/checkpoint/create.yaml': line 13, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: remove old checkpoint file from device\n ^ here\n"
}
The fix is to define nxos_config_checkpoint_filename
when passing to the role but it would be nice if it handled by the role.
- name: test
vars:
function: config_manager/load
config_manager_text: show version
nxos_config_checkpoint_filename: chk_ansible
import_role:
name: ansible-network.cisco_nxos
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.