Ansible snippets - splitting variables
A useful Ansible snippet - splitting a variable value in Ansible.
the stuffs - splitting a variable using .split Let’s paint a picture. Say there’s an application that needs upgraded. It’s distributed via a tarball. There is a service setup using a symlink - software -> software-1.2.3. The workflow would be something like…
Untar a file. Change the symlink to point to the new folder (software -> software-2.0.0). There’s already a variable for the tar file name.