thanks could it be that hyphen - are not allowed in the variable string?
[email protected] schrieb am Mittwoch, 21. Oktober 2020 um 02:05:25 UTC+2: > On Wed, 21 Oct 2020 01:54:11 +0200 > Vladimir Botka <[email protected]> wrote: > > > On Tue, 20 Oct 2020 14:54:34 -0700 (PDT) > > Gisbert Haas <[email protected]> wrote: > > > - name: get business ID > > > set_fact: > > > my_var: "{{ inventory_hostname | > > > regex_findall('.+?(?=-).+?(?=-).+?(?=-).+?(?=-)+') }}" > > > > > > ok: [DE-LEI-GRO-GROLE-F001-FW01-MDF] => { > > > "my_var": [ > > > "DE-LEI-GRO-GROLE" > > > The bracket '[' tells us the variable my_var is a list. It's not > > clear how the set_fact above managed to create the list. > > The filter regex_findall returns a list of matches > > https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/core.py#L137 > > -- > Vladimir Botka > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/548d9aa9-5922-4c0b-a80d-3db9f664b768n%40googlegroups.com.
