commit b9f615dcb3478c41c391ae06ef1e1636b108f952 Author: Eric Meehan Date: Fri Feb 27 17:30:50 2026 -0500 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +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 +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +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). diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..ba247cc --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# defaults file for ansible-role-gitea diff --git a/handlers/main.yml b/handlers/main.yml new file mode 100644 index 0000000..010c05c --- /dev/null +++ b/handlers/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# handlers file for ansible-role-gitea diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..36b9858 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,35 @@ +#SPDX-License-Identifier: MIT-0 +galaxy_info: + author: your name + description: your role description + 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: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + 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. diff --git a/tasks/.actions.yaml.swp b/tasks/.actions.yaml.swp new file mode 100644 index 0000000..69b1a9d Binary files /dev/null and b/tasks/.actions.yaml.swp differ diff --git a/tasks/.gitea.yaml.swp b/tasks/.gitea.yaml.swp new file mode 100644 index 0000000..d757d4e Binary files /dev/null and b/tasks/.gitea.yaml.swp differ diff --git a/tasks/.main.yml.swp b/tasks/.main.yml.swp new file mode 100644 index 0000000..f2fdf23 Binary files /dev/null and b/tasks/.main.yml.swp differ diff --git a/tasks/actions.yaml b/tasks/actions.yaml new file mode 100644 index 0000000..ff7b2b2 --- /dev/null +++ b/tasks/actions.yaml @@ -0,0 +1,23 @@ +- name: deploy actions + kubernetes.core.helm: + name: gitea + chart_ref: gitea/actions + release_namespace: gitea + create_namespace: true + values: + enabled: true + provisioning: + enabled: true + statefulset: + actRunner: + config: | + log: + level: debug + cache: + enabled: false + runner: + labels: + - "ubuntu-latest:docker://node:16-bullseye" + - "ubuntu-22.04:docker://node:16-bullseye" + - "ubuntu-20.04:docker://node:16-bullseye" + - "ubuntu-18.04:docker://node:16-buster" diff --git a/tasks/gitea.yaml b/tasks/gitea.yaml new file mode 100644 index 0000000..31d7495 --- /dev/null +++ b/tasks/gitea.yaml @@ -0,0 +1,105 @@ +--- +# tasks file for gitea +- name: add gitea repo + kubernetes.core.helm_repository: + name: gitea + repo_url: https://dl.gitea.com/charts/ + register: repo_update + +- name: update repos + command: helm repo update + when: repo_update.changed + +- name: deploy gitea + kubernetes.core.helm: + name: gitea + chart_ref: gitea/gitea + release_namespace: gitea + create_namespace: true + values: + image: + pullPolicy: IfNotPresent + service: + ssh: + type: LoadBalancer + ingress: + enabled: true + className: nginx + annotations: + cert-manager.io/cluster-issuer: ca-issuer + hosts: + - host: gitea.eom.dev + paths: + - path: / + pathType: Prefix + tls: + - hosts: + - gitea.eom.dev + secretName: gitea-tls + persistence: + size: 2Ti + gitea: + metrics: + enabled: true + admin: + username: gitea_admin + password: "{{ gitea_admin_password }}" + email: gitea@postfix.eom.dev + ldap: + - name: OpenLDAP + securityProtocol: unencrypted + host: openldap.openldap.svc.cluster.local + port: 389 + userSearchBase: dc=eom,dc=dev + userFilter: (&(objectClass=posixAccount)(uid=%s)(memberOf=cn=Gitea Users,ou=Gitea,ou=Services,dc=eom,dc=dev)) + adminFilter: (memberOf=cn=Gitea Administrators,ou=Gitea,ou=Services,dc=eom,dc=dev) + emailAttribute: mail + bindDn: cn=readonly,dc=eom,dc=dev + bindPassword: "{{ openldap_readonly_password }}" + usernameAttribute: uid + publicSSHKeyAttribute: sshPublicKey + config: + APP_NAME: "Gitea" + service: + DISABLE_REGISTRATION: false + SHOW_REGISTRATION_BUTTON: true + DEFAULT_ALLOW_CREATE_ORGANIZATION: false + ALLOW_ONLY_EXTERNAL_REGISTRATION: false + ENABLE_NOTIFY_MAIL: true + oauth2_client: + ENABLE_AUTO_REGISTRATION: true + UPDATE_AVATAR: true + ACCOUNT_LINKING: auto + mailer: + ENABLED: true + SMTP_ADDR: postfix.eom.dev + SMTP_PORT: 587 + USER: gitea + PASSWD: "{{ gitea_admin_password }}" + FROM: Gitea + ENVELOPE_FROM: gitea@eom.dev + redis: + enabled: true + global: + redis: + password: "{{ gitea_admin_password }}" + persistence: + enabled: true + redis-cluster: + enabled: false + postgresql: + enabled: true + image: + tag: 16.4.0-debian-12-r9 + global: + postgresql: + auth: + username: gitea + password: "{{ gitea_admin_password }}" + database: gitea + primary: + persistence: + enabled: true + size: 2Ti + postgresql-ha: + enabled: false diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..07803e6 --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,8 @@ +#SPDX-License-Identifier: MIT-0 +--- +# tasks file for ansible-role-gitea +- name: gitea + include_tasks: "{{ item }}" + loop: + - gitea.yaml + - actions.yaml diff --git a/tests/inventory b/tests/inventory new file mode 100644 index 0000000..03ca42f --- /dev/null +++ b/tests/inventory @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +localhost + diff --git a/tests/test.yml b/tests/test.yml new file mode 100644 index 0000000..0627e47 --- /dev/null +++ b/tests/test.yml @@ -0,0 +1,6 @@ +#SPDX-License-Identifier: MIT-0 +--- +- hosts: localhost + remote_user: root + roles: + - ansible-role-gitea diff --git a/vars/main.yml b/vars/main.yml new file mode 100644 index 0000000..17edae4 --- /dev/null +++ b/vars/main.yml @@ -0,0 +1,3 @@ +#SPDX-License-Identifier: MIT-0 +--- +# vars file for ansible-role-gitea