gitlab_project_variable – Creates/updates/deletes GitLab Projects Variables¶
New in version 2.9.
Synopsis¶
- When a project variable does not exist, it will be created.
- When a project variable does exist, its value will be updated when the values are different.
- Variables which are untouched in the playbook, but are not untouched in the GitLab project, they stay untouched (purge is false) or will be deleted (purge istrue).
Requirements¶
The below requirements are needed on the host that executes this module.
- python >= 2.7
- python-gitlab python module <= 1.12.1
Parameters¶
Examples¶
- 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
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Markus Bergholz (@markuman)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
