ansible and pyhton

27 views
Skip to first unread message

Anthony salvado

unread,
Dec 21, 2015, 7:18:49 AM12/21/15
to Ansible Project
hi all, 

i want use this on ansible variable : 

import re 
number1 = re.findall("\d+", ansible_hostname)

i've try this : 

number1: "{{ re.findall
('\d+', ansible_hostname) }}"

but it's not ok ^^ 

have you idea ? 

Anthony salvado

unread,
Dec 21, 2015, 7:21:20 AM12/21/15
to Ansible Project
i want find the number on the variable ansible_hostname :

for instance : 
dev1-client  --> i want 1
dev2-client --> i want 2
prod12-client --> i want 12

Reply all
Reply to author
Forward
0 new messages