In a playbook, I try to extract the last character of variable "ansible_hostname".
I try to use regex_replace filter to do that, but nothing works.
I simplified my piece of script with this ad-hoc command :
ansible localhost -m debug -a "msg= {{ 'devserver01' | regex_replace('[0-9]{1}$', '\1') }}"
I want to extract the last character : '1'.
I'm using Ansible 2.0.