It has been a while since our last hardcore technical post. So we decided to put steamy cloud posts aside for a moment and get down and dirty with one

Specification of the role argument

submited by
Style Pass
2021-05-20 14:10:01

It has been a while since our last hardcore technical post. So we decided to put steamy cloud posts aside for a moment and get down and dirty with one of the new features of Ansible Core 2.11: argument specification for Ansible roles.

We will start with a short description of how we can parameterize Ansible roles and what problems we can expect when using them. Next, we will give a high-level overview of the argument specification for Ansible roles, describe its benefits to the Ansible playbook and role authors, and go over a simple example.

And for those of you who will stick with us to the bitter end, we will even throw in a short story about an argument specification development.

If you would like to follow along, you will need to install the ansible-core Python package. To prevent making a mess out of your system, you should install Ansible Core into a new virtual environment:

The last command installed a prerelease version of Ansible Core. That version contains a critical bug fix that we need and is not part of the latest stable release yet. Stick to the end if you are interested in gory details.

Leave a Comment