New in version 2.9.
false) or will be deleted (purge is true).The below requirements are needed on the host that executes this module.
| Parameter | Choices/Defaults | Comments |
|---|---|---|
| api_password string | The password to use for authentication against the API | |
| api_token string / required | GitLab access token with API permissions. | |
| api_url string | The resolvable endpoint for the API | |
| api_username string | The username to use for authentication against the API | |
| project string / required | The path and name of the project. | |
| purge boolean |
| When set to true, all variables which are not untouched in the task will be deleted. |
| state string |
| Create or delete project variable. Possible values are present and absent. |
| validate_certs boolean |
| Whether or not to validate SSL certs when supplying a https endpoint. |
| vars dictionary | Default: {} | A list of key value pairs. |
- name: Set or update some CI/CD variables
gitlab_project_variable:
api_url: https://gitlab.com
api_token: secret_access_token
project: markuman/dotfiles
purge: false
vars:
ACCESS_KEY_ID: abc123
SECRET_ACCESS_KEY: 321cba
- name: Delete one variable
gitlab_project_variable:
api_url: https://gitlab.com
api_token: secret_access_token
project: markuman/dotfiles
state: absent
vars:
ACCESS_KEY_ID: abc123
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | |
|---|---|---|---|
| project_variable dictionary | always | Four lists of the variablenames which were added, updated, removed or exist. | |
| added list | always | A list of variables which were created. Sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] | |
| removed list | always | A list of variables which were deleted. Sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] | |
| untouched list | always | A list of variables which exist. Sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] | |
| updated list | always | A list of variables whose values were changed. Sample: ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY'] | |
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/gitlab_project_variable_module.html