On 17.10.23 19:34, Kathy Lyons wrote:
> When I print out "{{ ansible_play_name }}" I simply get "localhost."
>
> On Tue, Oct 17, 2023 at 12:18 PM 'Philippe Kueck' via Ansible Project
> <
ansible...@googlegroups.com
> <mailto:
ansible...@googlegroups.com>> wrote:
>
> Hi,
>
> On 17.10.23 18:13, Kathy Lyons wrote:
> > 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?
>
> How about this?
>
> ---
> - name: "foobar playbook"
> hosts: localhost
> gather_facts: no
> tasks:
> - debug:
> msg: '{{ansible_play_name}}'
> ...
>
> - Philippe
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit