ansible-collections / community.general

Ansible Community General Collection
https://galaxy.ansible.com/ui/repo/published/community/general/
GNU General Public License v3.0
811 stars 1.49k forks source link

gitlab_deploy_key: Ability to set expires_at variable for deploy key #7021

Open swoffish opened 1 year ago

swoffish commented 1 year ago

Summary

Ability to set expires_at variable for deploy key.

With new configuration in gitlab the expiration key for deploy keys cannot be left blank or be invalid (past 6 months)

We can no longer utilize the module to create our deploy keys. Moved to using the uri module for an API call instead.

Issue Type

Feature Idea

Component Name

gitlab_deploy_key

Additional Information


#  - name: add deploy key to repo
#    gitlab_deploy_key:
#      api_url: https://gitlab.endpoint.com
#      validate_certs: no
#      api_token: "{{ gitlab_access_token }}"
#      project: "{{ gitlab_group }}/{{ gitlab_project }}"
#     title: "Bot Build {{ patchbot_name }}"
#      state: present
#      can_push: yes
#      expires_at: cool
#      key: {{ deploy_key_txt }}

Code of Conduct

ansibullbot commented 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.

click here for bot help

ansibullbot commented 1 year ago

cc @Lunik @Shaps @lgatellier @marwatk @metanovii @nejch @scodeman @sh0shin @suukit @waheedi @zanssa click here for bot help

lgatellier commented 1 year ago

Hi @swoffish ,

Thanks for your feedback !

community.general's GitLab-related modules rely on python-gitlab, which doesn't support "expires_at" option yet for deploy keys API, as far as I know.

I suggest you to open an issue on python-gitlab GitHub project first.

nejch commented 1 year ago

Hi @swoffish ,

Thanks for your feedback !

community.general's GitLab-related modules rely on python-gitlab, which doesn't support "expires_at" option yet for deploy keys API, as far as I know.

I suggest you to open an issue on python-gitlab GitHub project first.

@lgatellier as mentioned in the other issue, python-gitlab can pass arbitrary API parameters to the server (for most endpoints). So it can be simply added here like the other arguments.

lgatellier commented 1 year ago

Hi @swoffish ,

Thanks for your feedback !

community.general's GitLab-related modules rely on python-gitlab, which doesn't support "expires_at" option yet for deploy keys API, as far as I know.

I suggest you to open an issue on python-gitlab GitHub project first.

@lgatellier as mentioned in the other issue, python-gitlab can pass arbitrary API parameters to the server (for most endpoints). So it can be simply added here like the other arguments.

Didn't know that, thanks!