December 2018
Intermediate to advanced
226 pages
4h 57m
English
This is the critical section where we use a specific module of Ansible (ios_command) to define what to execute on the network devices:
tasks: - name: run ping for the host ios_command: commands: ping 8.8.8.8 repeat 1 register: trace_result - name: Debug registered variables debug: var=trace_result
We define a ping 8.8.8.8 repeat 1 command and capture the result in a variable called trace_result, which is defined using the register keyword.
Finally, using the debug keyword, the output captured in the trace_result variable is displayed onscreen.
Read now
Unlock full access