Ansible: `lsb_release` Variable

The lsb_release -sc command displays the release codename of a Linux distribution in a short format. You can often meet this command while adding APT repositories, e.g. sudo apt-add-repository “deb [arch=amd64] $(lsb_release -cs) main”. To get the output of the lsb_release -sc command in Ansible, there is no actually a need to execute this […]

Ansible: Default Variables Values

In Ansible it is recommended to set default values for variables to avoid undefined-variable errors: The task includes an option with an undefined variable. The default variables for a role can be defined in the defaults/main.yml file that might look something like this: nginx_version: 1.20.1 nginx_service_name: “nginx.service” Ansible will use the default values only if […]