35 lines
1.4 KiB
YAML
35 lines
1.4 KiB
YAML
---
|
|
# 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
|
|
# What is expected (at a minimum):
|
|
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token
|
|
# -> gitea_org_name
|
|
# -> gitea_team_name
|
|
# -> gitea_team_state, present or absent (defaults to present)
|
|
# -> 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) }}"
|
|
state: "{{ gitea_team_state|default('present') }}"
|
|
org_name: "{{ gitea_org_name }}"
|
|
name: "{{ gitea_team_name }}"
|
|
description: "{{ gitea_team_desc|default(omit) }}"
|
|
members: "{{ gitea_team_members|default(omit) }}"
|
|
permission: "{{ gitea_permission|default(omit) }}"
|
|
permissions: "{{ gitea_permissions|default(omit) }}"
|
|
member_action: "add"
|
|
...
|