Prologas
(Prologas)
September 1, 2017, 8:07am
1
Hello,
strange output comes to my ansible console, but the task works as I expected?
name: WildFly copy listed wars to server vm1
copy: src={{ item }} dest=/tmp/ mode=0640 owner=wildfly group=wildfly
when:
ansible_default_ipv4.macaddress == “{{ wildfly_vm1_server_macaddress }}”
with_fileglob:
/tmp/wars/xxx.war
/tmp/wars/bbb.war
[WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ansible_default_ipv4.macaddress ==
“{{ wildfly_vm1_server_macaddress }}”
Thanks!
Uwe_Sauter
(Uwe Sauter)
September 1, 2017, 8:14am
2
There has been a change (I think between 1.9 and 2.x). As the warning explains, you should rewrite your when statement:
when:
- ansible_default_ipv4.macaddress == wildfly_vm1_server_macaddress
Uwe_Sauter
(Uwe Sauter)
September 1, 2017, 8:28am
3
Already did in my previous answer. You need to remove items like {{ }} or {% %}.
Prologas
(Prologas)
September 1, 2017, 8:29am
4
Thanks, I will check it out soon!
Prologas
(Prologas)
September 1, 2017, 9:42am
5
Don’t work:
wildfly_vm1_server_macaddress is undefined\n\nThe error appears to have been in
Prologas
(Prologas)
September 1, 2017, 9:50am
6
Sorry, my bad, I mistyped the var