cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1560
Views
5
Helpful
3
Replies

"IOS-XR CLI automation - Bash" Lab Notes/Fixes

Chuck White
Level 4
Level 4

First, thanks to those who wrote this lab.   It really helped me get started with IOS-XR automation.

 

For those of you working your way through the IOS-XR CLI automation - Bash lab in the DevNet Sandbox, here is a list of fixes to help you complete this lab.   

 

For all steps, the documentation on https://developer.cisco.com/learning/lab/01-iosxr-01-cli-automation-bash references 10.10.20.170.   This is not the IP address you need to use.   On the Lab Management screen, look in the left-hand Instructions box, under IOS XR Programmability, for the correct IP address to use throughout the lab.  Both times I started this lab, my IP was 10.10.20.70.

 

Under Step 3, before you can complete the section "Automating the entire process", you must first create the admin account's public keys.   You can do this by issuing ssh-keygen from the admin account.  It will look similar to the following, obviously the key information and randomart will be different:

 

devbox:~admin@devbox:~$ ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/home/admin/.ssh/id_rsa):       NOTE: LEAVE AS DEFAULT, HIT ENTER

Enter passphrase (empty for no passphrase):                                NOTE: LEAVE BLANK, HIT ENTER

Enter same passphrase again:                                                       NOTE: LEAVE BLANK, HIT ENTER

Your identification has been saved in /home/admin/.ssh/id_rsa.

Your public key has been saved in /home/admin/.ssh/id_rsa.pub.

The key fingerprint is: SHA256:InGWweqgng1ObkPKuJ8oMw5pOwxc9HMoisF0ZmgbeOU admin@devbox

The key's randomart image is:

+---[RSA 2048]----+

|. ..... |

|.=.* .o |

|+.B E.= |

|.o.o.B . |

|ooooo + S |

|+B .. . |

|#.+ |

|O%.o |

|*B= |

+----[SHA256]-----+

devbox:~admin@devbox:~$

 

Under Step 4, the first section you will encounter is "Using Ansible with ZTP bash utilities" / "Pull a docker image with the latest Ansible code".    Based on other forum posts, you cannot reach Docker's repository from these labs.   Fortunately, the docker image has already been pulled into this lab.  First, you need to verify that your lab already has the image by doing the following:

 

devbox:~admin@devbox:~$  docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

akshshar/ansible-docker latest 3e914c205589 13 months ago 595MB

pipeline 1.0.0 c2efe6584e13 19 months ago 130MB

debian stable-slim 9bfa9917d866 19 months ago 55.3MB

hello-world latest f2a91732366c 22 months ago 1.85kB

confluent/zookeeper 3.4.6-cp1 4a1778ad1528 3 years ago 584MB

confluent/kafka 0.10.0.0-cp1 2b9ba35e1775 3 years ago 584MB

 

If you have akshshar/ansible-docker in your list, you are good to move on to the next subsection: "Analyze the Ansible Playbook in the cloned git repo".    If not, I spent a lot of time trying to find a workaround before I actually checked "docker images".  

 

 

 

3 Replies 3

smupadhy
Cisco Employee
Cisco Employee

Hello Chuck,

 

Thanks for the detailed post! We are glad that the Learning lab and sandbox helped you get started with IOS-XR automation. 

 

We are in the process of updating the IOS-XR Learning labs so these issues should be addressed soon.

 

 

Regards,

Smita Upadhya 

 

 

 

 

Thank you for the quick replies.   I missed documenting another item.

 

In the GIT repository,  https://github.com/CiscoDevNet/iosxr-programmability-devnet-labs-code there are some places where the IP address of the environment needs to be modified to make the lab work.  

 

iosxr-programmability-devnet-labs-code/01-iosxr-01-cli-automation-bash/ztp_bash/ansible/ansible_hosts

iosxr-programmability-devnet-labs-code/01-iosxr-02-cli-automation-python/ztp_python/ansible/ansible_hosts

iosxr-programmability-devnet-labs-code/reset_setup/connection_details.sh

 

thodavie
Cisco Employee
Cisco Employee

Thanks for pointing these items out, Chuck! Really appreciated.

 

The Devnet team will look to update the learning lab ASAP.