change gitea to forgejo

This commit is contained in:
Louis Abel 2024-12-21 14:01:14 -07:00
parent 6d0ea79487
commit 8a0404e231
Signed by: label
GPG key ID: 2A6975660E424560
7 changed files with 101 additions and 101 deletions

View file

@ -1,10 +1,10 @@
--- ---
# This playbook is meant to be used with callable variables, like adhoc or AWX. # 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 # What: Creates an organization/group in Gitea, relying on the forgejo collection
# What is expected (at a minimum): # What is expected (at a minimum):
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token # -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
# -> gitea_org_name # -> forgejo_org_name
# -> gitea_org_owner, optional (defaults to token or api user if not set) # -> forgejo_org_owner, optional (defaults to token or api user if not set)
- name: Create Gitea Organization or Group - name: Create Gitea Organization or Group
hosts: all hosts: all
become: false become: false
@ -16,15 +16,15 @@
# Remove automated account # Remove automated account
tasks: tasks:
- name: "Create organization" - name: "Create organization"
lazyutilitynet.ansible_gitea.gitea_org: lazyutilitynet.ansible_forgejo.forgejo_org:
api_url: "https://{{ gitea_basename }}" api_url: "https://{{ forgejo_basename }}"
api_username: "{{ gitea_api_user|default(omit) }}" api_username: "{{ forgejo_api_user|default(omit) }}"
api_password: "{{ gitea_api_password|default(omit) }}" api_password: "{{ forgejo_api_password|default(omit) }}"
api_token: "{{ gitea_api_token|default(omit) }}" api_token: "{{ forgejo_api_token|default(omit) }}"
state: "{{ gitea_org_state|default('present') }}" state: "{{ forgejo_org_state|default('present') }}"
org_name: "{{ gitea_org_name }}" org_name: "{{ forgejo_org_name }}"
location: "{{ gitea_org_location|default(omit) }}" location: "{{ forgejo_org_location|default(omit) }}"
full_name: "{{ gitea_org_full_name|default(omit) }}" full_name: "{{ forgejo_org_full_name|default(omit) }}"
owner: "{{ gitea_org_owner|default(omit) }}" owner: "{{ forgejo_org_owner|default(omit) }}"
description: "{{ gitea_org_desc|default(omit) }}" description: "{{ forgejo_org_desc|default(omit) }}"
... ...

View file

@ -2,26 +2,26 @@
# This playbook is meant to be used with callable variables, like adhoc or AWX. # 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: Creates a repo for a Gitea Organization or User
# What is expected (at a minimum): # What is expected (at a minimum):
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token # -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
# -> gitea_repo_name # -> forgejo_repo_name
# -> gitea_repo_owner # -> forgejo_repo_owner
# -> gitea_repo_state # -> forgejo_repo_state
# Optional items: # Optional items:
# -> gitea_repo_desc # -> forgejo_repo_desc
# -> gitea_repo_private # -> forgejo_repo_private
# -> gitea_auto_init # -> forgejo_auto_init
# -> gitea_default_branch # -> forgejo_default_branch
# -> gitea_repo_license # -> forgejo_repo_license
# -> gitea_allow_merge_commits # -> forgejo_allow_merge_commits
# -> gitea_allow_rebase # -> forgejo_allow_rebase
# -> gitea_allow_rebase_explicit # -> forgejo_allow_rebase_explicit
# -> gitea_allow_squash_merge # -> forgejo_allow_squash_merge
# -> gitea_repo_archived # -> forgejo_repo_archived
# -> gitea_ignore_whitespace_conflicts # -> forgejo_ignore_whitespace_conflicts
# -> gitea_has_issues # -> forgejo_has_issues
# -> gitea_has_wiki # -> forgejo_has_wiki
# -> gitea_has_pull_requests # -> forgejo_has_pull_requests
# -> gitea_repo_website # -> forgejo_repo_website
- name: Create Gitea Repo for a User or Org - name: Create Gitea Repo for a User or Org
hosts: all hosts: all
become: false become: false
@ -31,27 +31,27 @@
# Create repo # Create repo
tasks: tasks:
- name: "Create Repository" - name: "Create Repository"
lazyutilitynet.ansible_gitea.gitea_repo: lazyutilitynet.ansible_forgejo.forgejo_repo:
api_url: "https://{{ gitea_basename }}" api_url: "https://{{ forgejo_basename }}"
api_username: "{{ gitea_api_user|default(omit) }}" api_username: "{{ forgejo_api_user|default(omit) }}"
api_password: "{{ gitea_api_password|default(omit) }}" api_password: "{{ forgejo_api_password|default(omit) }}"
api_token: "{{ gitea_api_token|default(omit) }}" api_token: "{{ forgejo_api_token|default(omit) }}"
state: "{{ gitea_repo_state|default('present') }}" state: "{{ forgejo_repo_state|default('present') }}"
owner: "{{ gitea_repo_owner }}" owner: "{{ forgejo_repo_owner }}"
name: "{{ gitea_repo_name }}" name: "{{ forgejo_repo_name }}"
description: "{{ gitea_repo_desc|default(omit) }}" description: "{{ forgejo_repo_desc|default(omit) }}"
private: "{{ gitea_repo_private|default(omit) }}" private: "{{ forgejo_repo_private|default(omit) }}"
auto_init: "{{ gitea_auto_init|default(omit) }}" auto_init: "{{ forgejo_auto_init|default(omit) }}"
default_branch: "{{ gitea_default_branch|default('main') }}" default_branch: "{{ forgejo_default_branch|default('main') }}"
license: "{{ gitea_repo_license|default(omit) }}" license: "{{ forgejo_repo_license|default(omit) }}"
allow_merge_commits: "{{ gitea_allow_merge_commits|default(omit) }}" allow_merge_commits: "{{ forgejo_allow_merge_commits|default(omit) }}"
allow_rebase: "{{ gitea_allow_rebase|default(omit) }}" allow_rebase: "{{ forgejo_allow_rebase|default(omit) }}"
allow_rebase_explicit: "{{ gitea_allow_rebase_explicit|default(omit) }}" allow_rebase_explicit: "{{ forgejo_allow_rebase_explicit|default(omit) }}"
allow_squash_merge: "{{ gitea_allow_squash_merge|default(omit) }}" allow_squash_merge: "{{ forgejo_allow_squash_merge|default(omit) }}"
archived: "{{ gitea_repo_archived|default(omit) }}" archived: "{{ forgejo_repo_archived|default(omit) }}"
ignore_whitespace_conflicts: "{{ gitea_ignore_whitespace_conflicts|default(omit) }}" ignore_whitespace_conflicts: "{{ forgejo_ignore_whitespace_conflicts|default(omit) }}"
has_issues: "{{ gitea_has_issues|default(omit) }}" has_issues: "{{ forgejo_has_issues|default(omit) }}"
has_wiki: "{{ gitea_has_wiki|default(omit) }}" has_wiki: "{{ forgejo_has_wiki|default(omit) }}"
has_pull_requests: "{{ gitea_has_pull_requests|default(omit) }}" has_pull_requests: "{{ forgejo_has_pull_requests|default(omit) }}"
website: "{{ gitea_repo_website|default(omit) }}" website: "{{ forgejo_repo_website|default(omit) }}"
... ...

View file

@ -1,14 +1,14 @@
--- ---
# This playbook is meant to be used with callable variables, like adhoc or AWX. # 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: Creates an team in a Gitea Organization, relying on the forgejo collection
# What is expected (at a minimum): # What is expected (at a minimum):
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token # -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
# -> gitea_org_name # -> forgejo_org_name
# -> gitea_team_name # -> forgejo_team_name
# -> gitea_team_state, present or absent (defaults to present) # -> forgejo_team_state, present or absent (defaults to present)
# -> gitea_permission, none/read/write/admin (default read) # -> forgejo_permission, none/read/write/admin (default read)
# -> gitea_permissions, this is a dictionary, cannot be paired with # -> forgejo_permissions, this is a dictionary, cannot be paired with
# gitea_permission # forgejo_permission
- name: Create Gitea Team in an Organization or Group - name: Create Gitea Team in an Organization or Group
hosts: all hosts: all
become: false become: false
@ -18,17 +18,17 @@
# Create team # Create team
tasks: tasks:
- name: "Create team and Add Users" - name: "Create team and Add Users"
lazyutilitynet.ansible_gitea.gitea_team: lazyutilitynet.ansible_forgejo.forgejo_team:
api_url: "https://{{ gitea_basename }}" api_url: "https://{{ forgejo_basename }}"
api_username: "{{ gitea_api_user|default(omit) }}" api_username: "{{ forgejo_api_user|default(omit) }}"
api_password: "{{ gitea_api_password|default(omit) }}" api_password: "{{ forgejo_api_password|default(omit) }}"
api_token: "{{ gitea_api_token|default(omit) }}" api_token: "{{ forgejo_api_token|default(omit) }}"
state: "{{ gitea_team_state|default('present') }}" state: "{{ forgejo_team_state|default('present') }}"
org_name: "{{ gitea_org_name }}" org_name: "{{ forgejo_org_name }}"
name: "{{ gitea_team_name }}" name: "{{ forgejo_team_name }}"
description: "{{ gitea_team_desc|default(omit) }}" description: "{{ forgejo_team_desc|default(omit) }}"
members: "{{ gitea_team_members|default(omit) }}" members: "{{ forgejo_team_members|default(omit) }}"
permission: "{{ gitea_permission|default(omit) }}" permission: "{{ forgejo_permission|default(omit) }}"
permissions: "{{ gitea_permissions|default(omit) }}" permissions: "{{ forgejo_permissions|default(omit) }}"
member_action: "add" member_action: "add"
... ...

View file

@ -1,12 +1,12 @@
--- ---
# This playbook is meant to be used with callable variables, like adhoc or AWX. # This playbook is meant to be used with callable variables, like adhoc or AWX.
# What: Modifies a team in a Gitea Organization, relying on the gitea collection # What: Modifies a team in a Gitea Organization, relying on the forgejo collection
# What is expected: # What is expected:
# -> gitea_api_user + gitea_api_password *OR* gitea_api_token # -> forgejo_api_user + forgejo_api_password *OR* forgejo_api_token
# -> gitea_org_name # -> forgejo_org_name
# -> gitea_team_name # -> forgejo_team_name
# -> gitea_team_members (in the form of a list) # -> forgejo_team_members (in the form of a list)
# -> gitea_team_action, add or remove # -> forgejo_team_action, add or remove
- name: Create Gitea Team in an Organization or Group - name: Create Gitea Team in an Organization or Group
hosts: all hosts: all
become: false become: false
@ -16,13 +16,13 @@
# Create team # Create team
tasks: tasks:
- name: "Create team and Add Users" - name: "Create team and Add Users"
lazyutilitynet.ansible_gitea.gitea_team: lazyutilitynet.ansible_forgejo.forgejo_team:
api_url: "https://{{ gitea_basename }}" api_url: "https://{{ forgejo_basename }}"
api_username: "{{ gitea_api_user|default(omit) }}" api_username: "{{ forgejo_api_user|default(omit) }}"
api_password: "{{ gitea_api_password|default(omit) }}" api_password: "{{ forgejo_api_password|default(omit) }}"
api_token: "{{ gitea_api_token|default(omit) }}" api_token: "{{ forgejo_api_token|default(omit) }}"
org_name: "{{ gitea_org_name }}" org_name: "{{ forgejo_org_name }}"
name: "{{ gitea_team_name }}" name: "{{ forgejo_team_name }}"
members: "{{ gitea_team_members }}" members: "{{ forgejo_team_members }}"
member_action: "{{ gitea_team_action }}" member_action: "{{ forgejo_team_action }}"
... ...

View file

@ -2,7 +2,7 @@
collections: collections:
- name: community.general - name: community.general
- name: ansible.posix - name: ansible.posix
- name: https://git.shootthej.net/lun/ansible-gitea.git - name: https://git.shootthej.net/lun/ansible-forgejo.git
type: git type: git
version: main version: main
... ...

View file

@ -3,7 +3,7 @@
hosts: all hosts: all
become: true become: true
vars: vars:
gitea_upgrade: "true" forgejo_upgrade: "true"
pre_tasks: pre_tasks:
- name: Check if ansible cannot be run here - name: Check if ansible cannot be run here
@ -19,7 +19,7 @@
fail_msg: "/etc/no-ansible exists - skipping run on this node" fail_msg: "/etc/no-ansible exists - skipping run on this node"
roles: roles:
- role: lazyutilitynet.ansible_gitea.gitea_install - role: lazyutilitynet.ansible_forgejo.forgejo_install
state: present state: present
post_tasks: post_tasks:

View file

@ -1,5 +1,5 @@
--- ---
# This does not use the gitea collection to install. Instead, we are installing # This does not use the forgejo collection to install. Instead, we are installing
# from our own packages built for EL/Fedora in Copr. # from our own packages built for EL/Fedora in Copr.
- name: Setup Gitea - name: Setup Gitea
hosts: all hosts: all
@ -21,22 +21,22 @@
success_msg: "We are able to run on this node" success_msg: "We are able to run on this node"
fail_msg: "/etc/no-ansible exists - skipping run on this node" fail_msg: "/etc/no-ansible exists - skipping run on this node"
# name: Enable the proper copr for gitea # name: Enable the proper copr for forgejo
# command: "dnf copr enable nalika/gitea -y" # command: "dnf copr enable nalika/forgejo -y"
# check_mode: false # check_mode: false
# changed_when: "1 != 1" # changed_when: "1 != 1"
roles: roles:
- role: lazyutilitynet.ansible_gitea.gitea_install - role: lazyutilitynet.ansible_forgejo.forgejo_install
state: present state: present
- role: rockylinux.ipagetcert - role: rockylinux.ipagetcert
state: present state: present
when: gitea_web_config_certs_internal|bool when: forgejo_web_config_certs_internal|bool
tasks: tasks:
- name: Install and Configure Gitea - name: Install and Configure Gitea
import_tasks: "tasks/gitea.yml" import_tasks: "tasks/forgejo.yml"
post_tasks: post_tasks:
- name: Open firewalld ports - name: Open firewalld ports