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.
# What: Creates an organization/group in Gitea, relying on the gitea collection
2022-03-28 00:53:47 +00:00
# What is expected (at a minimum):
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token
# -> gitea_org_name
# -> gitea_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"
lazyutilitynet.ansible_gitea.gitea_org:
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_org_state|default('present') }}"
org_name: "{{ gitea_org_name }}"
location: "{{ gitea_org_location|default(omit) }}"
full_name: "{{ gitea_org_full_name|default(omit) }}"
owner: "{{ gitea_org_owner|default(omit) }}"
description: "{{ gitea_org_desc|default(omit) }}"
2022-03-04 05:15:25 +00:00
...