I've finally managed to get it working by using with_items instead of loop Thanks anyway Vlad, Cheers
El mar, 11 jul 2023 a las 21:11, Vladimir Botka (<[email protected]>) escribió: > On Tue, 11 Jul 2023 20:42:30 +0100 > Jorge Rúa <[email protected]> wrote: > > > loop: > > - "{{ hostvars[inventory_hostname]['hostgroups'] }}" > > > > TASK [ Adding servers to each respective hostgroup] > > > ************************************************************************************************* > > ok: [aaa -> localhost] => (item=['foobar_service_web', > > 'foobar_service_unstable']) => { > > Try > > - debug: > msg: "echo {{ inventory_hostname }} {{ item }}" > loop: "{{ hostgroups|from_yaml }}" > > -- > 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/CAFtje5McWQbWsHHmbzDaMHRU0jdpLOMhoLdZvMXc642BOAqQAA%40mail.gmail.com.
