Defining our inventory

A quick bit of research shows us that Cumulus VX will use the standard SSH transport method of Ansible. Furthermore, there is just one module defined for working with this system—nclu. No prerequisite modules are required to use this module, so we can proceed straight to defining our inventory.

By default, Cumulus VX boots up with the management interface configured to get an IP address with DHCP. It also has three other virtual switch ports for us to test and play with the configuration of. A simple inventory to get this working would look something like this:

[cumulus]
mastery-switch1 ansible_host=192.168.81.142

[cumulus:vars]
ansible_user=cumulus
ansible_ssh_pass=CumulusLinux!

Note the following:

  • The IP address specified in ansible_host will almost certainly differ from mine—make sure you change this to the correct value for your Cumulus VX virtual machine. You might have to log in to the VM console to get the IP address.
  • Normally, you would never put the password in clear text in the inventory filehowever, for simplicity and to save time, we will specify the default password here. In a real-world use case, always use a Vault, or set up key-based SSH authentication.

Now, let's test connectivity with the ping module:

As we discussed earlier in this book, the Ansible ping module performs a complete end-to-end connectivity test, including authentication at the transport layer. As a result, if you received a successful test result like the one shown previously, we can proceed with confidence and write our first playbooks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.40.189