ansible.posix
ansible.posix copied to clipboard
authorized_key support GITHUB_TOKEN
SUMMARY
Support GITHUB_TOKEN for pulling the key. This will allow using Github Enterprise instances to pull the key from.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
authorized_key
ADDITIONAL INFORMATION
+1
Hi, thank you for reporting this.
If your request is for GITHUB_TOKEN support when you specified URL as a key
parameter like below,
- https://github.com/ansible-collections/ansible.posix/blob/main/plugins/modules/authorized_key.py#L91-L101
I think you probably need to request it to the ansible core side because authorized_key
module is just using fetch_url()
method that is defined in urls.py in ansible core:
- https://github.com/ansible-collections/ansible.posix/blob/main/plugins/modules/authorized_key.py#L558
- https://github.com/ansible/ansible/blob/devel/lib/ansible/module_utils/urls.py#L1701-L1703
Please let me know if I misunderstood your situation.
@saito-hideki correct, looking at https://github.com/ansible/ansible/blob/8510db4935a27fd190614a2cb7d41628a0f24def/lib/ansible/module_utils/urls.py#L1701 headers are supported, just tested and the following works
curl -H "Authorization: token xxxxxxxxxxxxxxxx" https://github.MYUSERNAME/api/v3/users/MYUSERNAME/keys
I tried doing https://[email protected]/api/v3/users/MYUSERNAME/keys which works with curl, but the response is in JSON