-
-
Notifications
You must be signed in to change notification settings - Fork 149
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
Use namespaced ansible_facts #44
Conversation
@cognifloyd - This is the first time I've ever seen Most of the blog posts and docs online refer to the |
This was introuduced in Ansible 2.5 (released in 2018). Here's the relevant section of 2.5 changelog's Major Changes (added in ansible/ansible@9c629f8):
Reasoning for this change is in ansible/ansible#18445 (comment)
And here's a section of the 2.5 porting guide. However the doc change wasn't added to the 2.5 porting guide until 2.7:
I follow the porting guides. As such, I switch to new behavior as soon as possible so that new things I write have the longest life span possible; I ensure that I have this setting as True when I run my playbooks so that I'm actively working with the new behavior instead of being passively surprised when the default changes on me. This change is safe for ansible 2.5+. Only roles that need to support <2.4 (EOL) need to continue supporting the old fact names. So, the choice is to remain backwards-compatible and risk forwards-compatibility, or to switch to the namespaced facts and be fully forwards-compatible but only backwards compatible down to ansible 2.5. If you don't want to use the namespaced vars, that's a fair choice. In that case, I will look for an alternative role, or continue to maintain another EPEL role. |
Also, the minimum ansible version was bumped in #45 from 2.4 to 2.5 to accomodate the |
If ansible's INJECT_FACTS_AS_VARS is disabled, then these roles will not work. So, use the namespaced version under ansible_facts. Namespaced facts was added in Ansible 2.5. https://docs.ansible.com/ansible/2.8/reference_appendices/config.html#inject-facts-as-vars
Rebased on master |
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark pull requests as stale. |
This pull request has been closed due to inactivity. If you feel this is in error, please reopen the pull request or file a new PR with the relevant details. |
This pull request has been marked 'stale' due to lack of recent activity. If there is no further activity, the PR will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark pull requests as stale. |
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
@geerlingguy Do you have a plan for this PR? The stalebot is vociferously opposed to it. |
This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution! Please read this blog post to see the reasons why I mark issues as stale. |
This pr has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details. |
If ansible's INJECT_FACTS_AS_VARS is disabled, then this role will not work. So, use the namespaced version under ansible_facts.
https://docs.ansible.com/ansible/2.8/reference_appendices/config.html#inject-facts-as-vars