Compare commits

..

9 Commits

Author SHA1 Message Date
jmrothst a1a4d87dc1 Merge ensure_gitea
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-10 21:48:42 -05:00
jmrothst 0462696924 Add 'roles/ensure_gitea/' from commit 'bd5905bbb394c09e1ff03aa03985eb8974a85b12'
git-subtree-dir: roles/ensure_gitea
git-subtree-mainline: 36de5666db
git-subtree-split: bd5905bbb3
2026-05-10 21:48:13 -05:00
jmrothst bd5905bbb3 Start gitea by default and remove mariadb configurations
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 19:20:08 -04:00
jmrothst e175a5c852 Disable gpg checks until I can find out why gitea isn't signing them
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 19:06:49 -04:00
jmrothst a563b361e1 Fix loop label
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 19:04:34 -04:00
jmrothst 4b375916e2 Add state
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 17:54:40 -04:00
jmrothst 36b5be7369 Fix the ansible fact for architecture
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 17:52:57 -04:00
jmrothst 8152f1d311 Remove templates we don't need
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 16:19:01 -04:00
jmrothst 1c15a25444 Initial Version
Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
2026-05-09 16:18:30 -04:00
14 changed files with 577 additions and 3 deletions
+163
View File
@@ -0,0 +1,163 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http s ://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license
document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms
and conditions of version 3 of the GNU General Public License, supplemented
by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser General
Public License, and the "GNU GPL" refers to version 3 of the GNU General Public
License.
"The Library" refers to a covered work governed by this License, other than
an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided by the
Library, but which is not otherwise based on the Library. Defining a subclass
of a class defined by the Library is deemed a mode of using an interface provided
by the Library.
A "Combined Work" is a work produced by combining or linking an Application
with the Library. The particular version of the Library with which the Combined
Work was made is also called the "Linked Version".
The "Minimal Corresponding Source" for a Combined Work means the Corresponding
Source for the Combined Work, excluding any source code for portions of the
Combined Work that, considered in isolation, are based on the Application,
and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the object
code and/or source code for the Application, including any data and utility
programs needed for reproducing the Combined Work from the Application, but
excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without
being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility
refers to a function or data to be supplied by an Application that uses the
facility (other than as an argument passed when the facility is invoked),
then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure
that, in the event an Application does not supply the function or data, the
facility still operates, and performs whatever part of its purpose remains
meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License
applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header
file that is part of the Library. You may convey such object code under terms
of your choice, provided that, if the incorporated material is not limited
to numerical parameters, data structure layouts and accessors, or small macros,
inline functions and templates (ten or fewer lines in length), you do both
of the following:
a) Give prominent notice with each copy of the object code that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together,
effectively do not restrict modification of the portions of the Library contained
in the Combined Work and reverse engineering for debugging such modifications,
if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library
is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during execution, include
the copyright notice for the Library among these notices, as well as a reference
directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License,
and the Corresponding Application Code in a form suitable for, and under terms
that permit, the user to recombine or relink the Application with a modified
version of the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A
suitable mechanism is one that (a) uses at run time a copy of the Library
already present on the user's computer system, and (b) will operate properly
with a modified version of the Library that is interface-compatible with the
Linked Version.
e) Provide Installation Information, but only if you would otherwise be required
to provide such information under section 6 of the GNU GPL, and only to the
extent that such information is necessary to install and execute a modified
version of the Combined Work produced by recombining or relinking the Application
with a modified version of the Linked Version. (If you use option 4d0, the
Installation Information must accompany the Minimal Corresponding Source and
Corresponding Application Code. If you use option 4d1, you must provide the
Installation Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side
by side in a single library together with other library facilities that are
not Applications and are not covered by this License, and convey such a combined
library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the
Library, uncombined with any other library facilities, conveyed under the
terms of this License.
b) Give prominent notice with the combined library that part of it is a work
based on the Library, and explaining where to find the accompanying uncombined
form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the
GNU Lesser General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to address
new problems or concerns.
Each version is given a distinguishing version number. If the Library as you
received it specifies that a certain numbered version of the GNU Lesser General
Public License "or any later version" applies to it, you have the option of
following the terms and conditions either of that published version or of
any later version published by the Free Software Foundation. If the Library
as you received it does not specify a version number of the GNU Lesser General
Public License, you may choose any version of the GNU Lesser General Public
License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether
future versions of the GNU Lesser General Public License shall apply, that
proxy's public statement of acceptance of any version is permanent authorization
for you to choose that version for the Library.
+40
View File
@@ -0,0 +1,40 @@
Role Name
=========
A brief description of the role goes here.
Requirements
------------
Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
Role Variables
--------------
| variable | default | description |
|-|-|-|
| mariadb&lowbar;vhost | inventory&lowbar;hostname | What mod&lowbar;md certificate should be used for MariaDB |
Dependencies
------------
A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
An optional section for the role authors to include contact information, or a website (HTML is not allowed).
+8
View File
@@ -0,0 +1,8 @@
---
# defaults file for ensure_gitea
gitea_database_type: 'mysql'
gitea_database_host: 'localhost:3306'
gitea_database_name: 'gitea'
gitea_database_user: 'gitea'
gitea_database_pass: 'SuperSecretSquirrel'
+28
View File
@@ -0,0 +1,28 @@
---
# handlers file for ensure_gitea
- name: 'ensure_gitea.package_facts'
ansible.builtin.package_facts:
- name: 'ensure_gitea.service_facts'
ansible.builtin.service_facts:
- name: 'ensure_gitea.service_reload'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["service_mgr"] == 'systemd'
- ensure_gitea is defined
ansible.builtin.systemd:
daemon_reload: 'yes'
- name: 'ensure_gitea.service_restart'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.service_list is defined
- ensure_gitea.service_list is iterable
- item.state == 'started'
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: 'restarted'
loop: '{{ ensure_gitea.service_list }}'
loop_control:
label: '{{ item.name }} will be restarted'
...
+53
View File
@@ -0,0 +1,53 @@
galaxy_info:
author: Jason Rothstein
description: Deploy MariaDB
company: your company (optional)
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Choose a valid license ID from https://spdx.org - some suggested licenses:
# - BSD-3-Clause (default)
# - MIT
# - GPL-2.0-or-later
# - GPL-3.0-only
# - Apache-2.0
# - CC-BY-4.0
license: LGPL-3.0-or-later
min_ansible_version: 2.9
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
#
# Provide a list of supported platforms, and for each platform a list of versions.
# If you don't wish to enumerate all versions for a particular platform, use 'all'.
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
# - name: Fedora
# versions:
# - all
# - 25
# - name: SomePlatform
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.
+217
View File
@@ -0,0 +1,217 @@
---
# tasks file for ensure_gitea
- name: 'include variables'
when:
- ansible_facts["system"] == 'Linux'
include_vars:
file: '{{ lookup("first_found", findme ) }}'
name: 'ensure_gitea'
vars:
findme:
files:
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["distribution"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["distribution"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-{{ ansible_facts["architecture"] }}.yml'
- '{{ ansible_facts["os_family"] }}-{{ ansible_facts["distribution_major_version"] }}-default.yml'
- '{{ ansible_facts["os_family"] }}-default.yml'
- 'default.yml'
paths:
- '../vars/'
errors: 'ignore'
- name: 'package discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["packages"] is not defined
ansible.builtin.package_facts:
- name: 'service discovery'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["services"] is not defined
ansible.builtin.service_facts:
- name: 'ensure yum repository'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts["pkg_mgr"] == 'dnf' or ansible_facts["pkg_mgr"] == 'dnf5' or ansible_facts["pkg_mgr"] == 'yum'
- ensure_gitea is defined
- ensure_gitea.yum_repository_list is defined
- ensure_gitea.yum_repository_list is iterable
ansible.builtin.yum_repository:
attributes: '{{ item.attributes | default(omit) }}'
bandwidth: '{{ item.bandwidth | default(omit) }}'
baseurl: '{{ item.baseurl | default(omit) }}'
countme: '{{ item.countme | default(omit) }}'
deltarpm_percentage: '{{ item.deltarpm_percentage | default(omit) }}'
description: '{{ item.description | default(omit) }}'
enabled: '{{ item.enabled | default(omit) }}'
enablegroups: '{{ item.enablegroups | default(omit) }}'
exclude: '{{ item.exclude | default(omit) }}'
failovermethod: '{{ item.failovermethod | default(omit) }}'
file: '{{ item.file | default(omit) }}'
gpgcheck: '{{ item.gpgcheck | default(omit) }}'
gpgkey: '{{ item.gpgkey | default(omit) }}'
group: '{{ item.group | default(omit) }}'
include: '{{ item.include | default(omit) }}'
includepkgs: '{{ item.includepkgs | default(omit) }}'
ip_resolve: '{{ item.ip_resolve | default(omit) }}'
metadata_expire: '{{ item.metadata_expire | default(omit) }}'
metalink: '{{ item.metalink | default(omit) }}'
mirrorlist: '{{ item.mirrorlist | default(omit) }}'
mode: '{{ item.mode | default(omit) }}'
module_hotfixes: '{{ item.module_hotfixes | default(omit) }}'
name: '{{ item.name }}'
owner: '{{ item.owner | default(omit) }}'
password: '{{ item.password | default(omit) }}'
priority: '{{ item.priority | default(omit) }}'
proxy: '{{ item.proxy | default(omit) }}'
proxy_password: '{{ item.proxy_password | default(omit) }}'
proxy_username: '{{ item.proxy_username | default(omit) }}'
repo_gpgcheck: '{{ item.repo_gpgcheck | default(omit) }}'
reposdir: '{{ item.reposdir | default(omit) }}'
retries: '{{ item.retries | default(omit) }}'
s3_enabled: '{{ item.s3_enabled | default(omit) }}'
selevel: '{{ item.selevel | default(omit) }}'
serole: '{{ item.serole | default(omit) }}'
setype: '{{ item.setype | default(omit) }}'
seuser: '{{ item.seuser | default(omit) }}'
skip_if_unavailable: '{{ item.skip_if_unavailable | default(omit) }}'
sslcacert: '{{ item.sslcacert | default(omit) }}'
sslclientcert: '{{ item.sslclientcert | default(omit) }}'
sslclientkey: '{{ item.sslclientkey | default(omit) }}'
sslverify: '{{ item.sslverify | default(omit) }}'
state: '{{ item.state }}'
throttle: '{{ item.throttle | default(omit) }}'
timeout: '{{ item.timeout | default(omit) }}'
unsafe_writes: '{{ item.unsafe_writes | default(omit) }}'
username: '{{ item.username | default(omit) }}'
loop: '{{ ensure_gitea.yum_repository_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure sysctl'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.sysctl_list is defined
- ensure_gitea.sysctl_list is iterable
ansible.posix.sysctl:
name: '{{ item.name }}'
reload: '{{ item.reload | default(omit) }}'
state: '{{ item.state }}'
sysctl_file: '{{ item.sysctl_file | default(omit) }}'
sysctl_set: '{{ item.sysctl_set | default(omit) }}'
value: '{{ item.value | default(omit) }}'
loop: '{{ ensure_gitea.sysctl_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.value }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure packages'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.package_list is defined
- ensure_gitea.package_list is iterable
ansible.builtin.package:
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_gitea.package_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure seboolean'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.seboolean_list is defined
- ensure_gitea.seboolean_list is iterable
ansible.posix.seboolean:
name: '{{ item.name }}'
persistent: '{{ item.persistent }}'
state: '{{ item.state }}'
loop: '{{ ensure_gitea.seboolean_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure configurations'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.template_list is defined
- ensure_gitea.template_list is iterable
ansible.builtin.template:
backup: 'no'
dest: '{{ item.dest }}'
group: '{{ item.group | default(omit) }}'
mode: '{{ item.mode | default(omit) }}'
owner: '{{ item.owner | default(omit) }}'
selevel: '{{ iteml.selevel | default(omit) }}'
serole: '{{ item.serole | default(omit) }}'
setype: '{{ item.setype | default(omit) }}'
seuser: '{{ item.seuser | default(omit) }}'
src: '{{ item.src }}'
loop: '{{ ensure_gitea.template_list }}'
loop_control:
label: '{{ item.dest }} will be ensured'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure firewall'
when:
- ansible_facts["system"] == 'Linux'
- ansible_facts.packages["firewalld"] is defined
- ansible_facts.packages["python3-firewall"] is defined
- ensure_gitea is defined
- ensure_gitea.firewall_list is defined
- ensure_gitea.firewall_list is iterable
ansible.posix.firewalld:
permanent: '{{ item.permanent }}'
service: '{{ item.service }}'
state: '{{ item.state }}'
loop: '{{ ensure_gitea.firewall_list }}'
loop_control:
label: '{{ item.service }} will be {{ item.state }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'ensure services'
when:
- ansible_facts["system"] == 'Linux'
- ensure_gitea is defined
- ensure_gitea.service_list is defined
- ensure_gitea.service_list is iterable
ansible.builtin.service:
enabled: '{{ item.enabled }}'
name: '{{ item.name }}'
state: '{{ item.state }}'
loop: '{{ ensure_gitea.service_list }}'
loop_control:
label: '{{ item.name }} will be {{ item.state }}'
notify:
- 'ensure_gitea.package_facts'
- 'ensure_gitea.service_facts'
- 'ensure_gitea.service_reload'
- 'ensure_gitea.service_restart'
- name: 'flush handlers'
meta: 'flush_handlers'
...
+2
View File
@@ -0,0 +1,2 @@
localhost
+5
View File
@@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- ensure_gitea
@@ -0,0 +1,19 @@
---
# vars file for ensure_gitea
package_list:
- name: 'gitea'
state: 'present'
service_list:
- name: 'gitea.service'
state: 'started'
enabled: 'yes'
yum_repository_list:
- name: 'gitea-fedorapackages-fedora-{{ ansible_facts.distribution_major_version}}-{{ ansible_facts.architecture }}'
baseurl: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/fedora/{{ ansible_facts.distribution_major_version }}/{{ ansible_facts.architecture }}'
description: 'FedoraPackages - Fire Dragon GIT Repository - fedora - {{ ansible_facts.distribution_major_version }} - {{ ansible_facts.architecture }}'
enabled: true
gpgcheck: false
gpgkey: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/repository.key'
state: 'present'
...
@@ -0,0 +1,19 @@
---
# vars file for ensure_gitea
package_list:
- name: 'gitea'
state: 'present'
service_list:
- name: 'gitea.service'
state: 'started'
enabled: 'yes'
yum_repository_list:
- name: 'gitea-fedorapackages-fedora-{{ ansible_facts.distribution_major_version}}-{{ ansible_facts.architecture }}'
baseurl: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/fedora/{{ ansible_facts.distribution_major_version }}/{{ ansible_facts.architecture }}'
description: 'FedoraPackages - Fire Dragon GIT Repository - fedora - {{ ansible_facts.distribution_major_version }} - {{ ansible_facts.architecture }}'
enabled: true
gpgcheck: false
gpgkey: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/repository.key'
state: 'present'
...
@@ -0,0 +1,19 @@
---
# vars file for ensure_gitea
package_list:
- name: 'gitea'
state: 'present'
service_list:
- name: 'gitea.service'
state: 'started'
enabled: 'yes'
yum_repository_list:
- name: 'gitea-fedorapackages-fedora-{{ ansible_facts.distribution_major_version}}-{{ ansible_facts.architecture }}'
baseurl: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/fedora/{{ ansible_facts.distribution_major_version }}/{{ ansible_facts.architecture }}'
description: 'FedoraPackages - Fire Dragon GIT Repository - fedora - {{ ansible_facts.distribution_major_version }} - {{ ansible_facts.architecture }}'
enabled: true
gpgcheck: false
gpgkey: 'https://git.fdragon.com/api/packages/FedoraPackages/rpm/repository.key'
state: 'present'
...
+2
View File
@@ -0,0 +1,2 @@
---
# vars file for ensure_gitea
+2
View File
@@ -0,0 +1,2 @@
---
# vars file for ensure_gitea
-3
View File
@@ -1,8 +1,5 @@
---
roles:
- name: 'ensure_gitea'
src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_gitea.git'
version: 'main'
- name: 'ensure_mariadb'
src: 'git+https://git.fdragon.com/AnsibleRoles/ensure_mariadb.git'
version: 'master'