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

remove deprecated environment variables for 2.0.0 #173

Merged
merged 5 commits into from
Nov 6, 2021

Conversation

briantist
Copy link
Collaborator

SUMMARY

Removes deprecated env vars for the 2.0.0 release:

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

auth.py

ADDITIONAL INFORMATION

This completes the breaking changes that came from #10

@briantist briantist added this to the v2.0.0 milestone Nov 3, 2021
@briantist briantist self-assigned this Nov 3, 2021
@briantist briantist temporarily deployed to docs-build November 3, 2021 13:26 Inactive
@briantist briantist temporarily deployed to docs-build November 4, 2021 17:58 Inactive
@codecov
Copy link

codecov bot commented Nov 4, 2021

Codecov Report

Merging #173 (41a1798) into main (af71153) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #173   +/-   ##
=======================================
  Coverage   91.68%   91.68%           
=======================================
  Files          40       40           
  Lines        1587     1587           
  Branches      123      123           
=======================================
  Hits         1455     1455           
  Misses        119      119           
  Partials       13       13           
Flag Coverage Δ
env_docker-default 91.68% <ø> (ø)
integration 75.80% <ø> (ø)
py2.6 36.18% <ø> (ø)
py2.7 83.49% <ø> (ø)
py3.10 90.80% <ø> (ø)
py3.5 83.74% <ø> (ø)
py3.6 83.74% <ø> (ø)
py3.7 83.74% <ø> (ø)
py3.8 90.86% <ø> (ø)
py3.9 90.86% <ø> (ø)
sanity 37.76% <ø> (ø)
target_ansible-doc 100.00% <ø> (ø)
target_auth_approle 89.47% <ø> (ø)
target_auth_cert 56.40% <ø> (ø)
target_auth_jwt 91.30% <ø> (ø)
target_auth_none 100.00% <ø> (ø)
target_auth_token 71.42% <ø> (ø)
target_connection_options 74.76% <ø> (ø)
target_controller 67.00% <ø> (ø)
target_import 37.76% <ø> (ø)
target_lookup_hashi_vault 81.33% <ø> (ø)
target_lookup_vault_read 90.00% <ø> (ø)
target_module_utils 90.40% <ø> (ø)
target_module_vault_read 92.10% <ø> (ø)
units 88.78% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
plugins/doc_fragments/auth.py 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af71153...41a1798. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Nov 5, 2021

##Docs Build 📝

Thank you for contribution!✨

This PR has been merged and the docs are now incorporated into main:
https://community-hashi-vault-main.surge.sh

@felixfontein
Copy link
Contributor

recheck

@briantist briantist merged commit 71d99e3 into ansible-collections:main Nov 6, 2021
@gdykeman
Copy link

@briantist @felixfontein
Prepending the variable names with ansible_* | ANSIBLE_* breaks use of custom credentials in AWX / Ansible Automation Platform. Not sure of best way to resolve but wanted to bring to your attention.

@briantist
Copy link
Collaborator Author

@gdykeman this has been discussed in #49

The alternative is to use Ansible vars instead which do not have the same restriction in AWX.

@gdykeman
Copy link

@briantist Correct, the concern is that sensitive variables are exposed. Thus we were hoping to utilize custom credentials which do now allow for ansible to be prepended. We can stick with modifying the docfragments if it creates too much of a problem.

@felixfontein
Copy link
Contributor

I'm not sure why AWX/Tower doesn't like these, but prefixing with ANSIBLE_ for env vars is what modules and plugins should do. See ansible/ansible#52967 and the Ansible project meeting where this was discussed and decided.

@briantist
Copy link
Collaborator Author

briantist commented Feb 24, 2022

@briantist Correct, the concern is that sensitive variables are exposed. Thus we were hoping to utilize custom credentials which do now allow for ansible to be prepended. We can stick with modifying the docfragments if it creates too much of a problem.

AWX credentials can inject its values as either environment variables or as Ansible vars. By injecting as Ansible vars, you will avoid this issue, because the ansible_ prefix restriction only applies to environment variables, not to Ansible vars.

The issue I linked is where others brought up the concerns, and using Ansible vars completely solves the issue, there should be no reason to modify any docs fragments.

@briantist
Copy link
Collaborator Author

I'm not sure why AWX/Tower doesn't like these, but prefixing with ANSIBLE_ for env vars is what modules and plugins should do. See ansible/ansible#52967 and the Ansible project meeting where this was discussed and decided.

I agree with you and have tried to argue the same. Here's a partial answer: ansible/awx#10275 (comment)

I guess the issue is that you could use those creds to widely control Ansible behavior in ways beyond plugin configuration? But yeah, it does mean that you cannot use env vars in that way to assign options, so plugins should need to be specific about accepting vars: in addition (which I think is good practice anyway).

@gdykeman
Copy link

This is the check:
https://github.com/ansible/awx/blob/devel/awx/main/fields.py#L816

Appreciate the quick responses!

@briantist
Copy link
Collaborator Author

This is the check: https://github.com/ansible/awx/blob/devel/awx/main/fields.py#L816

Appreciate the quick responses!

Yes, again that is the check for environment variables, if you choose to inject as Ansible vars instead, there is so such check. Please read the linked thread.

@briantist
Copy link
Collaborator Author

@gdykeman
Copy link

@briantist @felixfontein
This clears it up. Thank you for looking into this. Will stick to Ansible vars!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants