Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

What to do if the Ansible jinja 2 if/elif/ else construct does not work?

Asked by Chris Dyer Sep 12, 2023 1.5K views 1 answer
Share

About this question

 I use a jinja2 template to create various files. The differences are dependent on set variables. 

It should template the second template when the production_env is set to dev. The elif condition has stopped working. However, I used a debug task to get the output of the set variable, and it is set to dev. Ansible renders the first block if the dev is set properly. This process worked adequately before. But now it does not work. 

I have ditched the fit block and set the else. But it is not working. Any idea regarding this? 

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.