Skip to content


ModiPy 1.2 Released

I’m pleased to announce that version 1.2 of ModiPy has been released. You can grab it from the CheeseShop like this:

easy_install ModiPy

Easy!

What’s New?

This version of ModiPy is the most stable yet. It’s still beta, since there are some areas that don’t have enough test coverage yet, but we’re definitely getting there. We’ve also added a bunch of much wanted features.

Iterators

Iterators are like a for loop wrapped around a change. Unlike a standard for loop, and iterator uses dictionaries, so you can define a whole set of variable that can all change for each iteration.

So you can define a change that runs the same set of commands, but over 3 different base directories. Or you can add a series of license keys to a program, with the one change.

It’s variable substitution on steroids.

There’s support for manually defined iterators, where you type it all out yourself, or you can use a CSV file to define variables as columns, and the values in rows. Database support is coming, so you can integrate more easily with your CMDB. For now, you’ll have to manually export as CSV.

Complex Dependency Trees

You can define really complex trees of changes that will all execute in the right order, even in backout mode.

We’ve also added the noop flag for changes, so you can define an empty change with no targets (which would normally be an error) to act as a synchronisation point in your dependency tree.

Handy Command Line Options

We’ve added a few commandline options to help with testing, which we use ourselves.

–only will run just the changes you specify on the commandline

–skip is the opposite of –only, and will not run the change you specify. It is marked as successful for dependency purposes.

–sessionlog allows you to set the name of the logfile used for logging what happened.

Logging

All sessions are now logged by default, so you can audit what changes are applied to your environment. We’ll be adding an option to disable logging for those who need to run things unlogged.

Stay Tuned

We’re working hard on getting another version out soon. Please let us know if you hit a bug, or if you want a feature we haven’t already noted down in the tracker.

Until then, have fun automating your world!

Posted in Features.

ModiPy update: Automated NetApp simulator installation

Just a quick note to let you know about something I worked on a bit this past weekend.

I’ve been adding a bunch of test cases to ModiPy to make the code quality better, and to chase down some corner cases that were really annoying me.

I’m pleased to say that I’ve got bunch of tests written, and the code passes most of them.

Most interestingly, the real world example that kicked off this bughunt was my desire to automate the installation and baseline configuration of a NetApp simulator. I do this a bunch, and wanted to stop having to remember all the steps to set one up, get some disks connected to it, configure both nodes, license the cluster, etc., etc. Yawn.

In my professional life, we get installation engineers to do this for physical Filers by following a written, printed document, called a Build guide. It’s a manual process. Some parts of it have to be, like getting it plugged in and connected to a network. But from then on, it could be automated. Better yet, we can then automate the testing of the configuration to make sure it’s correct, before the engineer leaves the site. People make mistakes, so do installation engineers. Having to manually check all the settings are correct on a newly installed 6070 cluster is a major pain in the ass.

Sure, you could write your own custom Makefile or shell script. But that sucks, and doing all the error checking is the biggest pain. Wouldn’t it be great if you could just grab a template from somewhere that does 95% of what you want, and just tweak a few variables?

Show me the code

That’s one of the goals of ModiPy. So, I’ve uploaded the configuration I just used to successfully install a NetApp simulator as a 2 node cluster, configured with an IP address, hostname and the cluster licensed. It’s even had secureadmin configured so once you boot it up from now on, you can talk directly to the simulator via ssh, just like a real Filer. You can check out the example ModiPy config by clicking here.

The next stage will be to add some change templates that give me a few test lab setups so I can quickly run up some test configs whenever I need to test, say, iSCSI, or moving volumes between physicals using ndmpcopy.

And, of course, I’ll be sharing them with you. Aren’t you lucky?

Posted in Development, Howto. Tagged with , , , .