any way to avoid jinja warning in when condition [WARNING]: when statements should not include jinja2 templating delimiters such as {{ }} or {% %}. Found: ‘{{ tomcat.resweb.version }}-{{ tomcat.resweb.build }}’ not in webpage.content
#used the alternative solution tomcat.resweb.version ~ ‘-’ ~ tomcat.resweb.build not in webpage.content but its not taking the value from the variable file
Then you must have some errors in your code, because this is something that people use every day.
But since you haven't shared any code it is impossible to help.
name: Fail when the version does not match
action: fail
when: tomcat.resweb.version~ ‘-’ ~tomcat.resweb.build not in webpage.content
register: version_check
Debug log
TASK [resweb : Fail when the version does not match] *************************************************************************************************
task path: /home/vj7h/allegiant_git/sdlc_deploy/roles/resweb/tasks/main.yml:158
fatal: [lhqqa1rwbws01.qa1.allegiantair.com]: FAILED! => {
“changed”: false,
“msg”: “Failed as requested from task”
}
…ignoring
META: ran handlers
META: ran handlers
Read vars_file ‘vars/versions.yml’
skipping vars_file ‘vars/{{ ansible_domain }}/jboss_properties_vars_commercial.yml’ due to an undefined variable
Looks like you are not leaving a space between the vars and operators,
~ should not be attached to the var name.
tomcat.resweb.version ~ '-' ~ tomcat.resweb.build
Build ec2 instances with attaching multiple tags names :-
For example- I have launched one ec2 instance with tag name “websever1” the next builds of ec2 instances should start with tag name webserver2 , webserver3 … automatically.