Ansible and Cumulus Linux

Written by Mitch in Automation on Sat 07 February 2015. Tags: ansible, automation, cumuluslinux,

Description

I don't get around to writing these nearly enough. At work I got my hands on a pair of switchs from Penguin Computing. They're whitebox switches running Cumulus Linux. Which is, as they describe it, not based on Linux, it IS Linux. Making me fully right at home. Cumulus Networks has done really well being part of the automation scene since they're inception. They have written modules for Ansible and Puppet to make configuring their switches easier. Which I will be utilizing in this post.

Goals

  • Setup base configuration on switch
  • Setup persitance across OS upgrades
  • Upgrade Switch to CumulusLinux 2.5.0

This will required that your ansible.cfg file has included the Library directory of the CumulusLinux Modules.

Base Ansible Directory

.
├── ansible.cfg
├── configure.yml
├── group_vars
│   ├── all
│   └── rack-3
├── hosts
├── LICENSE
├── README.md
├── roles
│   ├── common
│   │   ├── files
│   │   │   └── backups
│   │   ├── tasks
│   │   │   └── main.yml   
│   │   └── templates  method of implementing vlans
│   │       ├── hostname.j2
│   │       ├── hosts.j2
│   │       └── motd.j2
│   ├── interfaces
│   │   └── tasks
│   │       └── main.yml
│   └── upgrade_sw
│       └── tasks
│           └── main.yml
└── upgrade-switch.yml

Quick run through of the important bits. I haven't done any massive deployments but my plans for deployment are based on Racks, and I haven't quite figured out a good DRY method for handling VLANs in these files so, if you know of a better way would love to hear it.

I have an ansible.cfg file in this directory so I can add an include for having the CumulusLinux modules in the same directory. I also have kept my ...

Continue reading »


Trying out Ansible

Written by Mitch in Linux on Sat 19 July 2014. Tags: draft, ansible, devops, automation, configuration management,

So, I've been using SaltStack for quite a while... and while I like it, I find it doesn't do everything that I want it to do. Case in point... I have a group of webservers and I run nginx for a load balancer. How can I dynamically add servers in the webservers group into the backend definition on the nginx load balancer config? Haven't seen a clean/easy way to handle this in SaltStack, but Ansible handles it easily.

Ansible

Ansible is a configuration management, written in Python, and uses SSH instead of a client on my managed nodes. Since I work in somewhat of an MSP type of environment. I would prefer to leave no trace on the systems I mange. Ansible provides that, as it cleans up after itself after a deployment.

One of the common deployment scenarios I have is for copying over my teams SSH keys, and setting up some basic monitoring with munin and nagios (however, if you've followed my blog, you'd know I'm not real found of them). All of The files mentioned here can be found on my GitHub page. Here we go

First, my directory layout, then I'll show the contents of the files.

.
├── authorized.yml
├── hosts
├── LICENSE
├── README.md
├── roles
│   ├── common
│   │   ├── files
│   │   │   └── 01-AnsibleManaged
│   │   └── tasks
│   │       └── main.yml
│   └── munin
│       ├── handlers
│       │   └── main.yml
│       ├── tasks
│       │   └── main.yml
│       └── templates
│           ├── munin.conf.jinja
│           └── munin-node.conf.jinja
└── site.yml

Ansible directory/file layouts are somewhat fixed, but I believe it works ...

Continue reading »