Monday 5 May 2014

Puppet Apprentice

Puppeteer

As I move my career towards the world of DevOps and automation / orchestration, I feel I need to learn the latest tools of trade for these fields. So, to that end, I'm installing the free version of Puppet Enterprise as a proof of concept. I've heard many people tell me how fantastic a tool Puppet is but haven't actually played with it.

So here I go.

For those wondering, there isn't technically any difference between the enterprise version and the normal puppet version but there are plenty of add ons that require the enterprise version (so I believe). The enterprise version will allow control of up to 10 nodes for free which is more than enough for a proof of concept.

I'm also hoping to build Puppet into a larger story about automation and orchestration.

Just to clarify, if you don't know the difference between automation and orchestration or think they mean the same thing here's the useful definition:
Automation is like musicians in an orchestra, looking the music and following the instructions, the orchestrator is the person up the front conducting, making sure everyone is on the same page and working together as a team.

In other words, the musicians are like the scripts or tools we use in lots of place to do useful work, like puppet agents or like simple shell scripts whilst the orchestrator would be something that can connect lots of systems and coordinate their efforts into something more useful than individual automations.

Hopefully that makes sense. There's a definite distinction between these two terms and it's useful to have an understanding of both for forming a bigger picture.

I'll post again when I've had time to play with my new puppet installation and have managed to make it do useful work.

Cheers.

Tuesday 4 February 2014

Tail in Windows

One of the most useful tools to solve a computer problem is log files. Log files can tell you lots of information about what is happening when a problem occurs. The problem with log files though is that they can often be enormous in size and this creates its own needle in the haystack problem.

The solution as any seasoned *nix admin will tell you is to use tail -f to monitor the log file in real time then attempt to trigger the problem again and see what pops up. If you are lucky the last few lines will relate to your problem and you'll be much wiser about how to solve it.

Now move that process to windows. I've been doing a lot of automation work in windows of late using powershell. Having to solve various problems under windows and lamented the lack of a useful tool like tail. Sure there are stand alone utilities that can perform that function but none seemed to be as simple as tail.

That is until I discovered powershell. Specifically Powershell version 3. Perhaps to appease people like me they have added a '-tail' option to the get-content commandlet. This command simple gets the content of a file. When you combine the tail option with the wait option, you can see anything that's added to the file in real time:

C:> get-content -path "somelogfile.txt" -wait -tail 10

The wait parameter tells get-content to keep waiting for new data to be added whilst the tail parameter says to show the last 10 lines of the file.

In order to get powershell version 3 onto you machine you will need to download an update.