31 lines
1.2 KiB
YAML
31 lines
1.2 KiB
YAML
---
|
|
# This playbook is meant to be used with callable variables, like adhoc or AWX.
|
|
# What: Creates an organization/group in Gitea, relying on the forgejo collection
|
|
# What is expected (at a minimum):
|
|
# -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
|
|
# -> forgejo_org_name
|
|
# -> forgejo_org_owner, optional (defaults to token or api user if not set)
|
|
- name: Create Gitea Organization or Group
|
|
hosts: all
|
|
become: false
|
|
vars_files:
|
|
- "vars/common.yml"
|
|
|
|
# Create org
|
|
# Optionally assign user as part of owner team
|
|
# Remove automated account
|
|
tasks:
|
|
- name: "Create organization"
|
|
lazyutilitynet.ansible_forgejo.forgejo_org:
|
|
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_org_state|default('present') }}"
|
|
org_name: "{{ forgejo_org_name }}"
|
|
location: "{{ forgejo_org_location|default(omit) }}"
|
|
full_name: "{{ forgejo_org_full_name|default(omit) }}"
|
|
owner: "{{ forgejo_org_owner|default(omit) }}"
|
|
description: "{{ forgejo_org_desc|default(omit) }}"
|
|
...
|