Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter bare variable with |bool (deprecation warn) #57691

Merged
merged 2 commits into from Jun 17, 2019

Conversation

Projects
None yet
4 participants
@asouini
Copy link
Contributor

commented Jun 11, 2019

SUMMARY

ansible issues a deprecation warning if you are using a bare variable with when, it suggests you filter the expression using the |bool filter

updated doc so it's up to date.

       > [DEPRECATION WARNING]: evaluating xxxxxx as a bare variable, this 
       > behaviour will go away and you might need to add |bool to the expression in the
       >  future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature 
       > will be removed in version 2.12. Deprecation warnings can be disabled by 
       > setting deprecation_warnings=False in ansible.cfg.
ISSUE TYPE
  • Docs Pull Request

see discussion at #53428

+label: docsite_pr

filter bare variable with |bool (deprecation warn)
##### SUMMARY
ansible issues a deprecation warning if you are using a bare variable with when, it suggests you filter the expression using the |bool filter

updated doc so it's up to date.

           > [DEPRECATION WARNING]: evaluating xxxxxx as a bare variable, this 
           > behaviour will go away and you might need to add |bool to the expression in the
           >  future. Also see CONDITIONAL_BARE_VARS configuration toggle.. This feature 
           > will be removed in version 2.12. Deprecation warnings can be disabled by 
           > setting deprecation_warnings=False in ansible.cfg.


##### ISSUE TYPE
- Docs Pull Request

see discussion at #53428

+label: docsite_pr
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@samccann

This comment has been minimized.

Copy link
Contributor

commented Jun 14, 2019

Thanks @asouini for this proposed fix. I believe the underlying behaviour has now been fixed by PR #57190. As such, can you modify the example so that it's not using a boolean (that is - not piping a boolean into bool). I think the rest is good and needed, but the other PR fixes the bool to bool problem.

@asouini

This comment has been minimized.

Copy link
Contributor Author

commented Jun 17, 2019

hey @samccann, thanks for the review, added the example.

@ansibot ansibot removed the small_patch label Jun 17, 2019

@samccann samccann merged commit a096fa5 into ansible:devel Jun 17, 2019

1 check passed

Shippable Run 127978 status is SUCCESS.
Details
@samccann

This comment has been minimized.

Copy link
Contributor

commented Jun 17, 2019

Thanks @asouini for clarifying that Ansible documentation section!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.