ansible and builder creation/provisioning etc
July 19, 2012
I posted this to the ansible list but I thought I’d point it out here, too:
For fedora infrastructure we wanted to make our builders trivial to refresh and reinstall. They hadn’t been that easy to do before and ideally I wanted something I could have done without any user intervention at all.
However, I did not want to just instantiate a pre-existing image for multiple reasons:
1. b/c it includes an implicit amount of staleness in the img – and ongoing maintenance
2. b/c it includes a certain amount of dirtiness b/c of the sysprep scripts are not as clean as a brand-new kickstart is
3. in any case I wanted something that could work in other places and with other virt tools.
The above is a first cut – but it mimics the vm kickstarting process we use for a lot of hosts in fedora infrastructure. However, it does it all using ansible to flow-control the whole thing.
I’m positive someone will mention some other mechanism I could have used to do the same thing. I’m not very interested, to be honest. I wanted something that:
1. didn’t require me to do a bunch of special magic in the kickstart %post to be able to molest/handle the instance (in this case I just need to suck down an authorized_keys file)
2. didn’t require any special software installed on the instance (in this case ansible only needs a running sshd – which I cannot imagine installing a system w/o)
3. was relatively easy to work with for the future.
4. something that was so loosely tied to any specific instance-creation program or platform that I could easily swap out one for the other or make it modular w/o a massive restructuring.
5. was in python
anyway – it worked very nicely to spin up the 35 buildvm instances for the current koji rebuild and if nothing else, I’m quite pleased with that.