gitlab_user: add expires_at option (#2450)

* gitlab_user: add expires_at option

* Add changelog

* Add integration test

* Add expires_at to addSshKeyToUser function

* password is required if state is set to present

* Check expires_at will not be added to a present ssh key

* add documentation about present ssh key

* add expires_at to unit tests

* Improve documentation

Co-authored-by: Felix Fontein <felix@fontein.de>

* Only pass expires_at to api when it is not None

* Emphasize on SSH public key

* Apply felixfontein suggestion

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Amin Vakil 2021-05-14 12:30:59 +04:30 committed by GitHub
commit 054eb90ae5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 172 additions and 14 deletions

View file

@ -56,7 +56,7 @@
- gitlab_user_state_again.user.is_admin == False
- name: Update User Test => Make User Admin
- name: Update User Test => Make User Admin
gitlab_user:
api_url: "{{ gitlab_host }}"
email: "{{ gitlab_user_email }}"
@ -189,8 +189,8 @@
api_url: "{{ gitlab_host }}"
validate_certs: False
# note: the only way to check if a password really is what it is expected
# to be is to use it for login, so we use it here instead of the
# note: the only way to check if a password really is what it is expected
# to be is to use it for login, so we use it here instead of the
# default token assuming that a user can always change its own password
api_username: "{{ gitlab_user }}"
api_password: "{{ gitlab_user_pass }}"
@ -205,8 +205,8 @@
- name: Check PW setting return state
assert:
that:
# note: there is no way to determine if a password has changed or
# not, so it can only be always yellow or always green, we
# note: there is no way to determine if a password has changed or
# not, so it can only be always yellow or always green, we
# decided for always green for now
- gitlab_user_state is not changed
@ -248,3 +248,5 @@
assert:
that:
- gitlab_user_state is not changed
- include_tasks: sshkey.yml