Ansible Pattern: Calculation Step

When there are a lot of paths, URLs or other strings to keep track of in a role it can get really messy. Especially if the some of them contain variables and are used in multiple places. Often to make roles easier to work with, I place a task at the tops of the role that calculates the variables so that they can easily be referred to later. It important to note that the set_fact role can set multiple facts at the same time. [Read More]

Ansible Pattern: Meta Role

This pattern is used to provide a quick way to include multiple roles at once. For example if you have a group of things that every server needs, you could use a meta role to include those things with one line. So lets say you have three roles for every machine named users, ssh and logs_to_syslog_server. You can include them all by making a role named common. In that common role you make a file named meta/main. [Read More]

Ansible Pattern: Downloading Artifacts

Often in Ansible I find myself needing to download an artifact. Whether it is a piece of software from GitHub or a build of some internal application that needs to be installed. One thing that is often important in these cases is speed of rollback. If something goes wrong with a new version I want the rollback to be fast, and preferable using preexisting files, and not downloading everything again. [Read More]