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?
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?
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?