# Is the current strategy visible to tasks?

**URL:** <https://forum.ansible.com/t/is-the-current-strategy-visible-to-tasks/4489>\
**Category:** Get Help\
**Tags:** strategy, variables, playbook, ansible-lint\
**Created:** [March 20, 2024, 7:03pm UTC](https://forum.ansible.com/t/is-the-current-strategy-visible-to-tasks/4489 "2024-03-20T19:03:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [March 20, 2024, 7:03pm UTC](https://forum.ansible.com/t/is-the-current-strategy-visible-to-tasks/4489/1 "2024-03-20T19:03:43Z")

</div>

Is a playbook’s current strategy exposed to tasks, perhaps through some unlisted [special variable](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html)?

I’m running into `ansible-lint`’s admonition, “run-once[task]: Using run\_once may behave differently if strategy is set to free.” I see no rational way around the issue except to “noqa” it away, but I’d like to implement some active defense in case someone ever tries to run with “`strategy: free`”, like maybe halting the play with a “Don’t do that!” message.

But if there’s no way for a task to see the current strategy, and the only way around the message is a “noqa”, I sort of have to wonder whether it’s actually accomplishing any good.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [March 21, 2024, 7:10am UTC](https://forum.ansible.com/t/is-the-current-strategy-visible-to-tasks/4489/2 "2024-03-21T07:10:01Z")

</div>

No. It is not. [_sigh_]  
Here’s a [pull request](https://github.com/ansible/ansible/pull/82871) to remedy that.

Edit: I meant that “No. It is not” as a response to the initial question: Is a playbook’s current strategy exposed to tasks? Upon reading the two posts back-to-back though, it reads like a response to the first post’s closing statement: “I have to wonder whether [`ansible-lint` is] actually accomplishing any good.” _This is not at all what I meant!_ `ansible-lint` is a wonderful tool which we use _all the time._ In fact, it’s precisely because we rely on it so much that even slight irritations with it affect us to exaggerated degrees. Much praise and thanks to everyone making `ansible-lint` so valuable.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [April 20, 2024, 7:10am UTC](https://forum.ansible.com/t/is-the-current-strategy-visible-to-tasks/4489/3 "2024-04-20T07:10:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
