ansible-gitea-management/adhoc-create-repo.yml
2022-04-07 14:17:14 -07:00

58 lines
2.3 KiB
YAML

---
# This playbook is meant to be used with callable variables, like adhoc or AWX.
# What: Creates a repo for a Gitea Organization or User
# What is expected (at a minimum):
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token
# -> gitea_repo_name
# -> gitea_repo_owner
# -> gitea_repo_state
# Optional items:
# -> gitea_repo_desc
# -> gitea_repo_private
# -> gitea_auto_init
# -> gitea_default_branch
# -> gitea_repo_license
# -> gitea_allow_merge_commits
# -> gitea_allow_rebase
# -> gitea_allow_rebase_explicit
# -> gitea_allow_squash_merge
# -> gitea_repo_archived
# -> gitea_ignore_whitespace_conflicts
# -> gitea_has_issues
# -> gitea_has_wiki
# -> gitea_has_pull_requests
# -> gitea_repo_website
- name: Create Gitea Repo for a User or Org
hosts: all
become: false
vars_files:
- "vars/common.yml"
# Create repo
tasks:
- name: "Create Repository"
lazyutilitynet.ansible_gitea.gitea_repo:
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_repo_state|default('present') }}"
owner: "{{ gitea_repo_owner }}"
name: "{{ gitea_repo_name }}"
description: "{{ gitea_repo_desc|default(omit) }}"
private: "{{ gitea_repo_private|default(omit) }}"
auto_init: "{{ gitea_auto_init|default(omit) }}"
default_branch: "{{ gitea_default_branch|default('main') }}"
license: "{{ gitea_repo_license|default(omit) }}"
allow_merge_commits: "{{ gitea_allow_merge_commits|default(omit) }}"
allow_rebase: "{{ gitea_allow_rebase|default(omit) }}"
allow_rebase_explicit: "{{ gitea_allow_rebase_explicit|default(omit) }}"
allow_squash_merge: "{{ gitea_allow_squash_merge|default(omit) }}"
archived: "{{ gitea_repo_archived|default(omit) }}"
ignore_whitespace_conflicts: "{{ gitea_ignore_whitespace_conflicts|default(omit) }}"
has_issues: "{{ gitea_has_issues|default(omit) }}"
has_wiki: "{{ gitea_has_wiki|default(omit) }}"
has_pull_requests: "{{ gitea_has_pull_requests|default(omit) }}"
website: "{{ gitea_repo_website|default(omit) }}"
...