On Sun, May 16, 2021 at 1:51 PM Vladimir Botka wrote:
> > I cannot use a default because this whole thing is relying
> > on whether it's defined or not later to take different actions.
> > the fuller example is:
> >
> > - name: determine_subnet
> >   when: >
> >     project == project_bake
> >     or hostvars[target].ipnet is defined
> >   set_fact:
> >     subnet: '{{
> >       (project == project_bake) | ternary(
> >         subnet_bake, determined_subnet
> >     )}}'
>
> What value of *subnet* do you want to set when '(project !=
> project_bake) and (determined_subnet is undefined)' ?

determined_subnet is always defined, except for project_bake.
project_bake nodes don't have ipnet set (or any inventory vars),
so the subnet url (for cloud api calls) can't be determined.  So
it gets hardcoded for that project.  Hence, the need for the
condition.

-- 
Scott

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CACRKOwxCFS6wayED9yqNCZjiErr_E9NkFCQY3N6C5Y4L6jgtFQ%40mail.gmail.com.

Reply via email to