2022-03-28 00:53:47 +00:00
|
|
|
---
|
|
|
|
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
|
|
|
# What: Creates an team in a Gitea Organization, relying on the gitea collection
|
2022-04-07 21:17:14 +00:00
|
|
|
# What is expected (at a minimum):
|
2022-03-28 00:53:47 +00:00
|
|
|
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token
|
|
|
|
# -> gitea_org_name
|
|
|
|
# -> gitea_team_name
|
2022-04-07 21:17:14 +00:00
|
|
|
# -> gitea_team_state, present or absent (defaults to present)
|
2022-03-28 00:53:47 +00:00
|
|
|
# -> gitea_permission, none/read/write/admin (default read)
|
|
|
|
# -> gitea_permissions, this is a dictionary, cannot be paired with
|
|
|
|
# gitea_permission
|
|
|
|
- name: Create Gitea Team in an Organization or Group
|
|
|
|
hosts: all
|
|
|
|
become: false
|
|
|
|
vars_files:
|
|
|
|
- "vars/common.yml"
|
|
|
|
|
|
|
|
# Create team
|
|
|
|
tasks:
|
|
|
|
- name: "Create team and Add Users"
|
|
|
|
lazyutilitynet.ansible_gitea.gitea_team:
|
|
|
|
api_url: "https://{{ gitea_basename }}"
|
|
|
|
api_username: "{{ gitea_api_user|default(omit) }}"
|
|
|
|
api_password: "{{ gitea_api_password|default(omit) }}"
|
|
|
|
api_token: "{{ gitea_api_token|default(omit) }}"
|
2022-04-07 21:17:14 +00:00
|
|
|
state: "{{ gitea_team_state|default('present') }}"
|
2022-03-28 00:53:47 +00:00
|
|
|
org_name: "{{ gitea_org_name }}"
|
|
|
|
name: "{{ gitea_team_name }}"
|
2022-04-07 21:17:14 +00:00
|
|
|
description: "{{ gitea_team_desc|default(omit) }}"
|
2022-03-28 00:53:47 +00:00
|
|
|
members: "{{ gitea_team_members|default(omit) }}"
|
|
|
|
permission: "{{ gitea_permission|default(omit) }}"
|
|
|
|
permissions: "{{ gitea_permissions|default(omit) }}"
|
|
|
|
member_action: "add"
|
|
|
|
...
|