Hey all, I am trying to repeat several tasks depending on how many servers 
I have in a certain group. Here is the code:

{% for machine in groups['cluster_nodes'] %}
- lineinfile: dest={{domain_home}}/servers/soa_server{{ loop.index + 1 
}}/security/boot.properties create=yes line="username={{wls_user}}"
- lineinfile: dest={{domain_home}}/servers/soa_server{{ loop.index + 1 
}}/security/boot.properties create=yes line="password={{wls_pw}}"

- lineinfile: dest={{domain_home}}/servers/oim_server{{ loop.index + 
1}}/security/boot.properties create=yes line="username={{wls_user}}"
- lineinfile: dest={{domain_home}}/servers/oim_server{{ loop.index + 
1}}/security/boot.properties create=yes line="password={{wls_pw}}"
{% endfor %}

However, when I try to do this I get the following error:

ERROR: Syntax Error while loading YAML script, /.../main.yml

Note: The error may actually appear before this position: line 171, column 2



{% for machine in groups['cluster_nodes'] %}

^

Not sure what I am doing wrong, as I thought every file in ansible gets put 
through the Jinja2 templating language..

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b7465af7-6ca9-48dc-bb2f-056d176617af%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to