1
1
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_gitea.git synced 2024-08-16 11:39:50 +02:00

Merge pull request #126 from roles-ansible/j2

andding jinja2 linter and improve template
This commit is contained in:
L3D 2023-10-21 02:21:39 +02:00 committed by GitHub
commit 4c00782214
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 26 deletions

View file

@ -11,14 +11,15 @@ jobs:
steps:
- name: 'checkout git repo'
uses: actions/checkout@v4.1.0
uses: actions/checkout@v4.1.1
with:
lfs: true
submodules: false
submodules: true
fetch-depth: 0
- name: Run ansible-lint
uses: ansible-actions/ansible-lint-action@v0.0.3
uses: ansible-actions/ansible-lint-action@v1.0.1
with:
target: "./"
python_dependency: "jmespath"
collections_yml: 'requirements.yml'
python_dependency: 'jmespath'

View file

@ -3,8 +3,6 @@ name: Galaxy release
# yamllint disable-line rule:truthy
on:
push:
branches: ['main']
release:
types: ['created']

22
.github/workflows/j2lint-check.yml vendored Normal file
View file

@ -0,0 +1,22 @@
---
name: Jinja2 Linting check
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
name: Jinja2 Linting
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Run j2lint
uses: ansible-actions/j2lint-action@v0.0.1
with:
target: "./"

22
.github/workflows/yamllint-check.yml vendored Normal file
View file

@ -0,0 +1,22 @@
---
name: Yamllint check
# yamllint disable-line rule:truthy
on: [push, pull_request]
jobs:
build:
name: Yamllint
runs-on: ubuntu-latest
steps:
- name: 'checkout git repo'
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Run yamllint
uses: ansible-actions/yamllint-action@v0.0.1
with:
target: "./"

View file

@ -1,4 +1,4 @@
[![Ansible Galaxy](https://ansible.l3d.space/svg/l3d.gitea.svg)](https://galaxy.ansible.com/l3d/gitea)
[![Ansible Galaxy](https://ansible.l3d.space/svg/l3d.gitea.svg)](https://galaxy.ansible.com/ui/standalone/roles/l3d/gitea/)
[![BSD-3 Clause](https://ansible.l3d.space/svg/l3d.gitea_license.svg)](LICENSE)
[![Maintainance](https://ansible.l3d.space/svg/l3d.gitea_maintainance.svg)](https://ansible.l3d.space/#l3d.gitea)
@ -15,7 +15,7 @@ This role is also Part of the Ansible-Collection [l3d.git](https://galaxy.ansibl
The following code has been tested with the latest Debian Stable, it should work on Ubuntu and RedHat as well.
```yaml
# ansible-galaxy install l3d.gitea
# ansible-galaxy role install l3d.gitea
- name: "Install gitea"
hosts: git.example.com
@ -385,11 +385,10 @@ This role uses the ``ansible.builtin`` and ``community.general`` ansible Collect
### Galaxy Collections
+ community.general
### Example requirements Installation
```
ansible-galaxy install community.general
pip3 install jmespath
ansible-galaxy collection install --update --role-file requirements.yml
pip3 install --update jmespath
```
## Contribute

4
requirements.yml Normal file
View file

@ -0,0 +1,4 @@
---
collections:
- name: community.general
source: https://galaxy.ansible.com

View file

@ -1,8 +1,8 @@
; this file is the configuration of your local gitea instance
; this file is the configuration of your local Gitea instance
; {{ ansible_managed }}
;
; This file overwrites the default values from gitea.
; undefined variables will use the default value from gitea.
; This file overwrites the default values from Gitea.
; undefined variables will use the default value from Gitea.
; Cheat Sheet: https://docs.gitea.com/next/administration/config-cheat-sheet/
;
; -> https://docs.gitea.com/next/administration/config-cheat-sheet#overall-default
@ -90,7 +90,7 @@ APP_DATA_PATH = {{ gitea_home }}/data
PROTOCOL = {{ gitea_protocol }}
DOMAIN = {{ gitea_http_domain }}
ROOT_URL = {{ gitea_root_url }}
HTTP_ADDR = {{ gitea_http_listen }}
HTTP_ADDR = {{ gitea_http_listen }}
HTTP_PORT = {{ gitea_http_port }}
START_SSH_SERVER = {{ gitea_start_ssh | ternary('true', 'false') }}
SSH_DOMAIN = {{ gitea_ssh_domain }}
@ -102,7 +102,7 @@ CERT_FILE = {{ gitea_tls_cert_file }}
KEY_FILE = {{ gitea_tls_key_file }}
{% endif %}
LANDING_PAGE = {{ gitea_landing_page }}
{% if gitea_lfs_server_enabled | bool -%}
{% if gitea_lfs_server_enabled | bool %}
LFS_START_SERVER = true
LFS_JWT_SECRET = {{ gitea_lfs_jwt_secret }}
{% endif %}
@ -110,9 +110,9 @@ REDIRECT_OTHER_PORT = {{ gitea_redirect_other_port | ternary('true', 'false') }}
PORT_TO_REDIRECT = {{ gitea_port_to_redirect }}
ENABLE_ACME = {{ gitea_enable_acme | ternary('true', 'false') }}
{% if gitea_enable_acme | bool %}
{% if gitea_acme_url != '' %}
{% if gitea_acme_url != '' %}
ACME_URL = {{ gitea_acme_url }}
{% endif %}
{% endif %}
ACME_ACCEPTTOS = {{ gitea_acme_accepttos | ternary('true', 'false') }}
ACME_DIRECTORY = {{ gitea_acme_directory }}
ACME_EMAIL = {{ gitea_acme_email }}
@ -194,14 +194,14 @@ ALLOW_ONLY_EXTERNAL_REGISTRATION = {{ gitea_allow_only_external_registration | t
[mailer]
ENABLED = {{ gitea_mailer_enabled | ternary('true', 'false') }}
{% if gitea_mailer_enabled | bool %}
{% if gitea_mailer_use_client_cert | bool %}
CLIENT_CERT_FILE = {{ gitea_mailer_client_cert_file }}
CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }}
{% endif %}
PROTOCOL = {{ gitea_mailer_protocol }}
SMTP_ADDR = {{ gitea_mailer_smtp_addr }}
SMTP_PORT = {{ gitea_mailer_smtp_port }}
USE_CLIENT_CERT = {{ gitea_mailer_use_client_cert | ternary('true', 'false') }}
{% if gitea_mailer_use_client_cert | bool %}
CLIENT_CERT_FILE = {{ gitea_mailer_client_cert_file }}
CLIENT_KEY_FILE = {{ gitea_mailer_client_key_file }}
{% endif %}
FORCE_TRUST_SERVER_CERT = {{ gitea_mailer_force_trust_server_cert | ternary('true', 'false') }}
USER = {{ gitea_mailer_user }}
PASSWD = {{ gitea_mailer_password }}
@ -305,8 +305,8 @@ SHOW_FOOTER_VERSION = {{ gitea_other_show_footer_version | ternary('true', 'fals
SHOW_FOOTER_TEMPLATE_LOAD_TIME = {{ gitea_other_show_footer_template_load_time | ternary('true', 'false') }}
ENABLE_SITEMAP = {{ gitea_other_enable_sitemap | ternary('true', 'false') }}
ENABLE_FEED = {{ gitea_other_enable_feed | ternary('true', 'false') }}
;
;
;
;
;
;
; Optional additional config
{{ gitea_extra_config }}

View file

@ -62,5 +62,5 @@ transfer_custom_footer:
- 'files/gitea_footer/extra_links_footer.tmpl'
- 'files/extra_links_footer.tmpl'
playbook_version_number: 51 # should be int
playbook_version_number: 52 # should be int
playbook_version_path: 'do1jlr.gitea.version'