From 30765d1ac49fb8929b40fea887696185af3db844 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Tue, 10 Oct 2023 09:07:06 +0200 Subject: [PATCH] updated gitea state --- states/gitea/defaults.yaml | 5 ++++- states/gitea/install.sls | 6 +++--- states/gitea/map.jinja | 10 ++++------ 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/states/gitea/defaults.yaml b/states/gitea/defaults.yaml index 7ed1f85..c90f806 100644 --- a/states/gitea/defaults.yaml +++ b/states/gitea/defaults.yaml @@ -1,12 +1,14 @@ --- gitea: + release_url: https://dl.gitea.io/gitea workingdir: /var/lib/gitea binfile: /var/lib/gitea/gitea configfile: /var/lib/gitea/custom/conf/app.ini user: git group: git version: "1.0.2" - arch: "amd64" + os: linux + arch: amd64 config: global: app_name: Gitea - Git with a cup of tea @@ -23,6 +25,7 @@ gitea: path: data/gitea.db repository: root: /var/lib/gitea/gitea-repositories + default_branch: master server: domain: git.example.com http_addr: "::" diff --git a/states/gitea/install.sls b/states/gitea/install.sls index da42452..f624950 100644 --- a/states/gitea/install.sls +++ b/states/gitea/install.sls @@ -18,10 +18,10 @@ git: gitea-bin: file.managed: - name: {{ gitea.workingdir }}/gitea - - source: "https://dl.gitea.io/gitea/{{ gitea.version }}/gitea-{{ gitea.version }}-linux-{{ gitea.arch }}" - - source_hash: "https://dl.gitea.io/gitea/{{ gitea.version }}/gitea-{{ gitea.version }}-linux-{{ gitea.arch }}.sha256" + - source: "{{ gitea.release_url }}/{{ gitea.version }}/gitea-{{ gitea.version }}-{{ gitea.os }}-{{ gitea.arch }}" + - source_hash: "{{ gitea.release_url }}/{{ gitea.version }}/gitea-{{ gitea.version }}-{{ gitea.os }}-{{ gitea.arch }}.sha256" - user: git - group: git - mode: 750 - require: - - git \ No newline at end of file + - git diff --git a/states/gitea/map.jinja b/states/gitea/map.jinja index f8839c4..4f6810a 100644 --- a/states/gitea/map.jinja +++ b/states/gitea/map.jinja @@ -3,11 +3,9 @@ {%- set os_family_map = salt['grains.filter_by']({ 'Debian': {}, 'Suse': {}, - 'Arch': { }, - 'RedHat': { }, - } - , grain="os_family" - , merge=salt['pillar.get']('gitea:lookup')) + 'Arch': {}, + 'RedHat': {}, + }, grain="os_family", merge=salt['pillar.get']('gitea:lookup')) -%} {%- do defaults.gitea.update(os_family_map) -%} @@ -16,4 +14,4 @@ default=defaults.gitea, merge=True ) --%} \ No newline at end of file +-%}