If you’re familiar with a certain place BB knows well, you’ll probably recognise the distinctively ornate and serpentine end of this public bench, being as it is entirely redolent of only one place. Yes, this is, of course, located in…
Problem: In this scenario, we have a potentially long list of usernames (accounts) and a directory containing SSH public keys, one per file with each file named after the user that owns that key. We want to deploy all the keys for the users in our list.
Many of the Ansible roles we write are concerned with installing and managing the configuration of a particular application or package. For example, we have a role that installs PHP and configures particular settings in the php.ini file according to a Jinja2 template.
Finally filled my 1TB NAS file server this year, to the point where the 30GB of images I brought back from New Zealand (oh-by-the-way, did-I-mention-we-went-to-NZ?) could not be dumped to disk, let alone processed. So it was time to exchange the two Samsung hard drives composing the mirrored data storage for new 2TB drives. I’m using ZFS on OpenIndiana - this should be easy, right?
Running down ten years of the MCU
Although they’re not making a huge fuss of it compared to the upcoming release of Avengers: Infinity Whoar, this year marks a decade of the Marvel Cinematic Universe, from its initial conception as a gleam in Nick Fury’s one good eye, in a post-credits sting tacked on to 2008’s Iron Man. So just like Marvel and, seemingly, everyone else, I thought I’d be totally original and do a list of all the films rated definitively and non-derivatively according to my own very personal criteria, which will almost certainly be completely unlike all the other lists because there’s a lot of scope for major disagreement when sizing up the relative merits of, say, The Avengers and The Incredible Hulk. (That last sentence, incidentally, was originally supposed to be a subplot in Age Of Ultron but got cut for being too wordy and syllable-ly at the studio’s insistence, like virtually everything else that made sense in the script.)
Yesterday I went to the National Museum of Wales in Cardiff for a lunchtime talk by David Hurn on his Swaps exhibition, currently showing in the museum’s newly-opened photography gallery. (It’s an excellent and illuminating display, incidentally; one of the few chances outside London to view prints by the likes of Cartier-Bresson, Robert Frank, Dorothea Lange, Elliot Erwitt and many other gifted photographers.)
Problem: you want to use data for one set of hosts to configure something on a different set of hosts. Specifically, there are some values in the host variables of the first group that you need to collect and use on one or more other hosts.
Now that Twitter has effectively become “the Daily Horror app”, I’ve gone back to reading conscientiously, and the book I am currently engrossed by is Electronic Dreams: How 1980s Britain learned to love the computer by Tom Lean. This is one of the few popular history books I’ve read where I can say “I was there”, and the resultant flood of memories has prompted this post that will probably be the nerd equivalent of Jumpers For Goalposts. (But it definitely won’t be about football, so it will be an improvement in one respect at least.)
Problem: you want to run a command in a loop within Ansible, registering the result of each run to a single variable, and then process those results depending on a condition. Specifically, you want to register the output of a command run over all the elements in a dictionary but then only process the elements where the command returned a particular result.