Three Drunken SysAds

Linux, Opensource, Devops and randomness…

First of all, apologies for the long title but I spent quite a while trying to find the answer for this one so I thought I’d (hopefully) make it obvious to find!

I’ve been working on a new project recently that uses the Flask framework for the web application and Flask-Security for authentication and authorisation. 

When presenting content based on whether a user is authenticated or not I had noticed that if you redirect to the login page, it doesn’t always redirect back to the page with the protected content.

For example, if in my template I have this:

{%if service.spotting_data.loco_id %}
SpotterInfo*:<br />
{%if current_user.is_authenticated()%}
Loco:{{ service.spotting_data.loco_id }}
<br />
Consist:{{ service.spotting_data.consist_info }}
{%else%}
We have information on the locomotive and consist for this service, however you need to
<a href="{{ url_for('security.login') }}"> log in</a> to see it
{% endif %}
{% endif %}

Then after logging in, the user will be redirected back to the home page. 

To fix this, you need to pass the argument “next” to url_for.

When you render_template, send the request object to the template:

render_template("template.html",request=request)

then in your template you can do

{{url_for('security.login',next=request.path)}}

and you will get redirected back to the page with the protected content on login.

EDIT: @darkflib gave the talk which can be found at http://vimeo.com/79408326

Today at DevOps Days London there was an awesome ignite talk and open-space about Burnout.

One of the things that came out of the open-space was just how common burnout is in our industry and how isolated people feel when they are going through it.

I’ve been there, I’m out the other side and I don’t have the issues that I used to have however I realise from today that we need to talk about this more often so here’s my attempt to summarise what happened to me, the signs that it might be happening to you, and what I did to escape it (although they come with the fairly obvious caveat that I’m not a medical professional and what worked for me may not work for you!).

 Names have been changed to protect the innocent (and the guilty!).

continue reading…

Over the past five years I’ve come to experience the delights of Puppet, CFEngine and Chef across a wide range of deployments ranging from a couple of web servers to host two or three hundred sites, to thousands of servers underpinning an OpenStack-based cloud solution.

I’d like to share a couple of thoughts on what I’ve learned, how to avoid making the same mistakes that I’ve made, and how to ensure that the next time you reach for your modules or cookbooks, you do it in a structured and sensible manner.

continue reading…

LAAAAAAADIESS ANNNNDDD GENNNELMEN…… LET’S GET READYYYYYYY TO RUMMMMMBBBBBLLLLLEEEEEEEE!!!!!!!!!

Ok, enough silliness. For the next few sentences anyway…

I’ve been using Puppet to mange systems for the last four years (at least!) however a new contract has meant I’ve needed to learn Chef. A few months ago I was looking for a blog post on the differences between puppet and Chef written from an objective point of view and the fantastic @nathenharvey produced a blog post about exactly that topic. The main take away from that blog post was that you should stop arguing about which is better and just make sure that you’re using some form of systems management tool, however there are many other good points made.

This post is more of a comment on my feelings about the two different systems and comparing the way in which they work.  Unlike Nathen, I didn’t have to make any of the WIIF decisions – the only question I had to ask was “Oh, they use Chef. Do I want a contract?” to which the answer to the second part will always override the first. I am new to Chef (I’ve been using it for a total of four hours now!) however I’m already starting to see some of the differences and I hope that this post will help others who find themselves in my position.

continue reading…

This is a subject which has been blogged about at length, however now that I’ve got this working I thought I’d blog about the key things I found here to make sure that not only do I get it right in future but also provide a reference to others who are trying to fix the same issues.

continue reading…

I’ve had pdnssec running for this domain and  a few others for some time now and the domains have been signed “locally” in preparation for signing by the parent domain.

continue reading…

This post is more of a reference for myself than anything else, however I thought it might come in handy for some others.  It’s bastardised from the install.sh which comes with nventory and will configure an Amazon Linux AMI for you.

The install script below installs nventory, rubygems and nginx from source and everything else from either the Amazon repo or Epel.

This means that you can install and configure this system on the Amazon Free Usage Tier using the “tiny” Amazon Linux ( amzn-ami-2011.09.1.x86_64-ebs ) and get a complete inventory server and puppetmaster for a year at zero cost!

continue reading…

Table of contents for Continuous Delivery of Server Configurations

  1. A New Hope…
  2. Deploy and Roll-back system configs with capistrano, mcollective and puppet
  3. Putting the butler to the test

The last two posts in this series have covered what the overall system will look like and how to ensure your puppet server is ready to receive the files from the SCM repo via capistrano – This post will cover setting up the test server using JenkinsCI and creating some tests.

We start by installing Jenkins.

continue reading…

Table of contents for Continuous Delivery of Server Configurations

  1. A New Hope…
  2. Deploy and Roll-back system configs with capistrano, mcollective and puppet
  3. Putting the butler to the test

I’ve been playing around with Capistrano over the past few weeks and I’ve recently created a way to use the power of Capistrano’s “deploy” and “rollback” features with Puppet and MCollective to enable me to have complete control over the deployment of my system configurations. continue reading…

Table of contents for Continuous Delivery of Server Configurations

  1. A New Hope…
  2. Deploy and Roll-back system configs with capistrano, mcollective and puppet
  3. Putting the butler to the test

OK, it’s May the fourth as I’ve started to write this and I couldn’t resist the title, but I hope that this first post in what I aim to deliver as a series of tutorials will help you move towards full testing, integration and deployment of your systems and turn what could be a five hour manual build and deploy routine into a single code commit.

continue reading…

Switch to our mobile site


Warning: Unknown: open(/var/lib/php/session/sess_is8eg9591l4rtr95ntt2jp6g54, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0