We use it in many instances to only do something for a specific playbook.
We have about 5 playbooks that work on different networks and rather than
maintain 5 different playbooks we use the "when playbook_name == abc.yml" a
lot. Is there another way to get the playbook name?

On Tue, Oct 17, 2023 at 11:08 AM Dick Visser <dnmvis...@gmail.com> wrote:

> My initial reaction would be: this looks like a workaround for something
> that does not exist, probably for a reason. And then you add mitogen to the
> mix, which is notorious for pushing the limits with many things.
>
> What is the use case for this playbook_name variable?
>
>
>
> Sent from Gmail Mobile
>
>
> On Tue, 17 Oct 2023 at 15:58, Kathy L <lyonsf...@gmail.com> wrote:
>
>> In the beginning of the playbook, I calculate the playbook_name this way:
>>
>> playbook_name: "{{ lookup('file', '/proc/self/cmdline') |
>> regex_replace('\u0000', ' ').split() | select match('match',
>> '^[a-zA-Z-_/0-9]*[.]y[a]*ml') | list|first|basename }}"
>>
>> This works in a typical, ssh playbook run.  We are now testing mitogen,
>> and using the playbook_name variable fails with the error:
>> "Make sure your variable name does not contain invalid characters like
>> '-': expected str, bytes or os.PathLike object, not AnsibleUndefined"
>>
>> The ansible-playbook name is configServer.yml so it doesn't contain any
>> strange characters.
>>
>> Has anyone else had this problem with mitogen?  is there another way to
>> get the playbook name being run?
>>
>> --
>> 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/41feabb8-15f9-461b-be84-08a899a5b010n%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/41feabb8-15f9-461b-be84-08a899a5b010n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/UcCnrJRs4iY/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CAF8BbLaOnMnU70b-x-TFH6XTtA33qLZfVkCHbhQ%2BGWET3NwsSg%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAF8BbLaOnMnU70b-x-TFH6XTtA33qLZfVkCHbhQ%2BGWET3NwsSg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAK9%2BsMfY8%3DTLoGQh924-T3Z63bC8bdGgYh9Dw6ssAV4LuVJ9hA%40mail.gmail.com.

Reply via email to