Open OlJohnny opened 1 year ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @bincyber @stpierre click here for bot help
This issue apparently occurs as it is assumed that Code 422
means that the key already exists.
Potentially the meaning of 422 changed / got extended.
Potentially the meaning of 422 changed / got extended.
Very well could be the case that the API response has been changed.
At the moment 422 means that the validation failed, funnily enough no mention of 'deploy key already exists' which probably was the meaning when this module was written
Summary
Use case: Trying to create a new deploy key for a github repo using the task from below
When the provided ssh key is anything but a valid ssh key the github REST API returns the following:
In my opinion the task should fail in this case, as it wasn't able to successfully create a deploy key on github. However the task returns
ok: [hostname]
I tested this with a reverse-proxy as a Man-In-The-Middle to obtain the request and response data.
Issue Type
Bug Report
Component Name
github_deploy_key
Ansible Version
Community.general Version
Configuration
OS / Environment
Steps to Reproduce
Using this task inside a role or playbook with a valid Personal Access Token (with admin permissions for repos) as
token
, your github username asowner
and an existing repository owned by you asrepo
. Important to reproduce the error: askey
use anything other than a valid ssh public keyExpected Results
if the key is anything but a valid ssh key, the github API returns 422 AND nothing gets added as a github deploy key
This component/task should exit with an error, as it wasn't able to adda github deploy key
Actual Results
no error gets returned
Code of Conduct