mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Add environment scope on gitlab project variables (#1197)
* add environment scope on gitlab project variables * fix sanity code * apply again test * environment_scope not defined by default. compatible with old versions of lib. * environment_scope must be optional * add changelog * Update changelogs/fragments/1197_gitlab_project_variable.yml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
3b9c6d496b
commit
52bb601f31
3 changed files with 56 additions and 10 deletions
|
@ -218,6 +218,36 @@
|
|||
that:
|
||||
- gitlab_project_variable_state is not changed
|
||||
|
||||
- name: change environment scope
|
||||
gitlab_project_variable:
|
||||
api_url: "{{ gitlab_host }}"
|
||||
api_token: "{{ gitlab_login_token }}"
|
||||
project: "{{ gitlab_project_name }}"
|
||||
vars:
|
||||
ACCESS_KEY_ID:
|
||||
environment_scope: testing
|
||||
register: gitlab_project_variable_state
|
||||
|
||||
- name: state must be changed
|
||||
assert:
|
||||
that:
|
||||
- gitlab_project_variable_state is changed
|
||||
|
||||
- name: apply again the environment scope change
|
||||
gitlab_project_variable:
|
||||
api_url: "{{ gitlab_host }}"
|
||||
api_token: "{{ gitlab_login_token }}"
|
||||
project: "{{ gitlab_project_name }}"
|
||||
vars:
|
||||
ACCESS_KEY_ID:
|
||||
environment_scope: testing
|
||||
register: gitlab_project_variable_state
|
||||
|
||||
- name: state must not be changed
|
||||
assert:
|
||||
that:
|
||||
- gitlab_project_variable_state is not changed
|
||||
|
||||
- name: purge all variables at the beginning
|
||||
gitlab_project_variable:
|
||||
api_url: "{{ gitlab_host }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue