Dens - Docs

Getting Started

This is a repository of my documentation for handy commonly used items:

Note

Please use at your own risk. These are from my own experience and may not work in your own lab. These scripts may break your system or lab or the whole time continuum !!!

Sphinx Documentation

Sphinx is an application helper to build documentation.

Note

Sphinx is fun.

Starting the Sphinx server

To start the sphinx server do the following

  1. Open a shell - in my case I use iterm.

    image1

  2. Change to the correct directory (in my case - /Users/grimard/Documents/Sphinx)

  3. Start the server with the following command:

    sphinx-autobuild DensDocs/ DensDocs/_build

How to build documents

To properly build Sphinx documentation you need to know a few things:

How to do formatting

  1. To create a master heading use a bunch of —— on a separate line

  2. To create a subheading use a bunch of ~~~~ on a separate line

  3. To create an ordered list (numbered) use the # symbol then a period.

  4. To add an image via a variable use:

    |image12|
    
  5. In this document I am using:

    - for top level
    ~ for sub headings
    

Variables for images

This is another subheading and ordered list for variables

To create a variable for an image file to be used in a page do the following:

  1. Define the variable as such:
.. |image8| image:: /_static/image008.png
:width: 0.46171in
:height: 0.43269in

Cloud’ish Things

I like clouds, here is stuff about clouds

Ansible

This is a collection of Ansible things

Ansible container

I have grabbed this one from Tom McGonagle SuperNetOps Ansible

SuperNetOps

This will be for Cloud Team’s SuperNetOps information.

SuperNetOps GitHub Repository

Super-NetOps is the new NetOps. This repo supports and auto-build integration with Docker Hub.

To learn more about Super-NetOps, read Does DevOps need a Super-NetOps’ Red Talks

To use the Super-NetOps container, visit SuperNetOps Github

Azure

This is a placeholder for Azure

AWS

Placeholder for AWS

Cloud 5

Placeholder for Cloud 5

Containers

This is a collection of the container things i have gathered - think hoarders - :)

Docker Basics

Install Docker for your OS - I am using a Mac so I downloaded and ran the Mac installer

List images

docker images

List containers

docker ps -a

Run shell within a container

docker exec -it -u root jenkins-2 /bin/bash

Container 2

In this lab we will review, line-by-line an example script that has been created to view the attributes of a BIG-IP Pool directly from the command line.

Task 1 – Review read_pool.py

  1. Open read_pool.py in Notepad++
  2. We will review the code. For brevity we have removed lines that are common with previous examples:
if not mgmt.tm.ltm.pools.pool.exists(partition=args.partition, name=args.pool_name):
raise Exception("Pool '%s' does not exist" % args.pool_name)

This if statement checks to see if a pool with the same name exists in the specified partition on the device. The key difference between this and the example in the previous lab is the inclusion of the ‘not’ keyword. This inverses the logic of the statement so that the Exception is raised when the pool DOES NOT exist

pool = mgmt.tm.ltm.pools.pool.load(partition=args.partition, name=args.pool_name)

This line loads the configuration of the pool into a variable

print "Pool %s:" % pool_path
pp.pprint(pool.raw)

These lines print the human-readable pool path and then uses the PrettyPrint library to dump all the attributes associated with the pool

Task 2 – Run read_pool.py

  1. In the command prompt type python read_pool.py 10.1.1.4 test_pool and examine the output:

    image70

  2. Notice the various attributes that are associated with the pool. Take note of the value of the loadBalancingMode attribute for the next lab

Putty Things

I like Play Dough - also called Creative Putty

Putty

Used to do ssh type stuff

Putty Commands

  1. Here is the first putty command

Rest Things

I like to REST, sometimes I even fall asleep.

REST

Useful rest information

REST Commands

  1. Here is the first rest command
curl -sk -u admin:password https://bigip.domain.com/mgmt/tm/ltm/pool -H "Content-Type: application/json" | sed 's/,/\'$'\n/g'