Posts

Showing posts with the label Networks

Using Ansible to Create, Delete and List Tenants

Image
Prepare the Environment In this demonstration I am using Cygwin to run the python/ansible scripts in a Windows environment. All my attempts to install ansible via ‘pip install’ in a Windows failed, the number of Stack Overflow posts reporting this problem seems to concur with this. Handy hint: To cd to a windows C: drive in Cygwin use: [code language="text"] cd /cygdrive/c [/code] To use Ansible with the APIC sandbox host, you will need to first establish a few files before you can start writing your playbooks. Verify that the installed ansible version is 2.8.x, and that it is using Python3: Create ansible.cfg file This file is used by Ansible to tell it that the inventory file is called hosts (unless overridden), to disable gathering of facts by default, and to disable the saving of retry files when playbooks stop with errors: ansible.cfg [code language="python"] [defaults] # Use local hosts file inventory = hosts # Disable automatic fac...

Using Cobra SDK and Arya to create a Tenant

Image
Getting the python and virtual environment set up These instructions are for a Windows set up. Use these instructions for setting up your Python virtual environment and for obtaining and installing the Cobra SDK and model. https://cobra.readthedocs.io/en/latest/install.html But essentially, if you're doing this for the first time, then do the following: Download and install python 2.7 from here (yes, version 2.7) https://www.python.org/downloads/ Download this python script to a chosen location, and run it using python. This will install pip. https://bootstrap.pypa.io/get-pip.py Run these pip commands. I found that I needed to run the pip2 executable as opposed to version 3 pip that was already installed, in order to successfuly install the requirements and run using python2 etc. [code language="txt"] pip install virtualenv pip install virtualenv-clone pip install virtualenvwrapper-win [/code] Run this command to create your virtual environment (See how i...