ansible-gitea-management/adhoc-create-org.yml

31 lines
1.2 KiB
YAML
Raw Normal View History

2022-03-04 05:15:25 +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 organization/group in Gitea, relying on the forgejo collection
2022-03-28 00:53:47 +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_org_owner, optional (defaults to token or api user if not set)
2022-03-04 05:15:25 +00:00
- 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
2022-03-04 05:15:25 +00:00
tasks:
2022-03-28 00:53:47 +00:00
- name: "Create organization"
2024-12-21 21:01:14 +00:00
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) }}"
2022-03-04 05:15:25 +00:00
...