Groups
Groups
Sign in
Groups
Groups
Ansible Project
Conversations
About
Send feedback
Help
need help on assigning a variable when string contains
20 views
Skip to first unread message
Sridhar Sambu
unread,
Jun 21, 2021, 11:42:12 AM
6/21/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
- name: abc
set_fact:
Var1: "TestVarable"
when: "{{'prod' in env}}"
I will pass env as prod so it should pick var1 as Testvariable.
Please help on correct syntax
Stefan Hornburg (Racke)
unread,
Jun 21, 2021, 12:59:35 PM
6/21/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
Hello Sridhar,
the when: condition is always evaluated as Jinja, so remove the curly braces:
when: "'prod' in env"
Regards
Racke
>
> --
> 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
ansible-proje...@googlegroups.com
<mailto:
ansible-proje...@googlegroups.com
>.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/8504deed-414a-4fc9-b28e-e3c2c05192a7n%40googlegroups.com
<
https://groups.google.com/d/msgid/ansible-project/8504deed-414a-4fc9-b28e-e3c2c05192a7n%40googlegroups.com?utm_medium=email&utm_source=footer
>.
--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.
Sridhar Sambu
unread,
Jun 21, 2021, 2:45:21 PM
6/21/21
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
Thank you
Reply all
Reply to author
Forward
0 new messages