2022-03-28 00:53:47 +00:00
|
|
|
---
|
|
|
|
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
2024-12-21 21:01:14 +00:00
|
|
|
# What: Creates an team in a Gitea Organization, relying on the forgejo collection
|
2022-04-07 21:17:14 +00:00
|
|
|
# What is expected (at a minimum):
|
2024-12-21 21:01:14 +00:00
|
|
|
# -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
|
|
|
|
# -> forgejo_org_name
|
|
|
|
# -> forgejo_team_name
|
|
|
|
# -> forgejo_team_state, present or absent (defaults to present)
|
|
|
|
# -> forgejo_permission, none/read/write/admin (default read)
|
|
|
|
# -> forgejo_permissions, this is a dictionary, cannot be paired with
|
|
|
|
# forgejo_permission
|
2022-03-28 00:53:47 +00:00
|
|
|
- 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"
|
2024-12-21 21:01:14 +00:00
|
|
|
lazyutilitynet.ansible_forgejo.forgejo_team:
|
|
|
|
api_url: "https://{{ forgejo_basename }}"
|
|
|
|
api_username: "{{ forgejo_api_user|default(omit) }}"
|
|
|
|
api_password: "{{ forgejo_api_password|default(omit) }}"
|
|
|
|
api_token: "{{ forgejo_api_token|default(omit) }}"
|
|
|
|
state: "{{ forgejo_team_state|default('present') }}"
|
|
|
|
org_name: "{{ forgejo_org_name }}"
|
|
|
|
name: "{{ forgejo_team_name }}"
|
|
|
|
description: "{{ forgejo_team_desc|default(omit) }}"
|
|
|
|
members: "{{ forgejo_team_members|default(omit) }}"
|
|
|
|
permission: "{{ forgejo_permission|default(omit) }}"
|
|
|
|
permissions: "{{ forgejo_permissions|default(omit) }}"
|
2022-03-28 00:53:47 +00:00
|
|
|
member_action: "add"
|
|
|
|
...
|