Conditional statements – making decisions in Ansible code

In a playbook or in a role sometimes we want to run different tasks based on different conditions. In most cases it depends on a fact (detail about the managed host) or some data collected during the playbook run. Ansible conditionals are there to make it possible to run different tasks based on different conditions, or skip executing tasks entirely.

Continue reading “Conditional statements – making decisions in Ansible code”

Loops in the Ansible code – the basics of iteration

Ansible loops and conditional statements are very cool inventions, but they are a double edged sword as well. The limitless freedom they give us can turn our roles into horrible mess. It is our responsibility to balance on the edge and use just the right amount of them in our code while we keep in mind that YAML is not a programming language.

Continue reading “Loops in the Ansible code – the basics of iteration”

Creating an Ansible role from a playbook: modular, reusable code

After we ran ad-hoc commands and created a monolith playbook, we will increase our level of automation. We will separate our code much better with introducing modular, reusable file structures called roles. Ansible roles will load variables, handlers and tasks automatically for us based on a defined directory and file structure.

Continue reading “Creating an Ansible role from a playbook: modular, reusable code”

The future of DevOps

A lot of people are talking about the future of the IT, the traditional operations work, and they are trying to guess whether they will have a job in IT in the future.

As I see most IT colleagues feel some uncertainty about their jobs. Different positions (and position names) come and go at the huge tech, telco and financial companies. The fluctuation of the people is also constant.

Do you think your job is in danger? Read further!

Continue reading “The future of DevOps”