[HowTo] How to combine Python methods with Jinja filters in Ansible

Ansible has a lot of ways to manipulate variables and their content. We shed some light on the different possibilities – and how to combine them. Ansible inbuilt filters One way to manipulate variables in Ansible is to use filters. Filters are connected to variables via pipes, |, and the result is the modified variable. Ansible offers … Continue reading [HowTo] How to combine Python methods with Jinja filters in Ansible

Insights into Ansible: environments of called playbooks

Usually when Ansible Tower executes a playbook everything works just as on the command line. However, in some corner cases the behavior might be different: Ansible Tower runs its playbooks in a specific environment. Different playbook results in Tower vs CLI Ansible is a great tool for automation, and Ansible Tower enhances these capabilities by … Continue reading Insights into Ansible: environments of called playbooks

[Howto] Access Red Hat Satellite REST API via Ansible

As with all tools, Red Hat Satellite offers a REST API. Ansible offers a simple way to access the API. Background Most of the programs and functions developed these days offer a REST API. Red Hat for example usually follows the “API first” methodology with most of the products these days, thus all functions of … Continue reading [Howto] Access Red Hat Satellite REST API via Ansible

[Howto] Looking up external directories in Ansible

Part of Ansible’s power comes from an easy integration with other systems. In this post I will cover how to look up data from external sources like DNS or Redis. Background A tool for automation is only as good as it is capable to integrate it with the already existing environment – thus with other … Continue reading [Howto] Looking up external directories in Ansible

[Howto] Introduction to Ansible variables

To become more flexible, Ansible offers the possibility to use variables in loops, but also to use information the target system provides. Background Ansible uses variables to enable more flexibility in playbooks and roles. They can be used to loop through a set of given values, access various information like the hostname of a system … Continue reading [Howto] Introduction to Ansible variables

[Short Tip] verify YAML in Shell via Python one-liner

Today the question came up how to verify YAML files easily. Of course, there are many very good online parser. But I was wondering if it is possible to do it simply in Bash/ZSH, using a Python one-liner. Here is the code: It throws an exception if the file is not a proper (aka importable) … Continue reading [Short Tip] verify YAML in Shell via Python one-liner