chore: Update template

This commit is contained in:
jeanluc
2023-04-11 09:52:38 +02:00
parent 5af9a75618
commit 1af36c6f21
18 changed files with 164 additions and 76 deletions

View File

@@ -4,8 +4,8 @@
Removes Gitea configuration. Has a dependency on `gitea.service.clean`_.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_service_clean = tplroot ~ ".service.clean" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
include:

View File

@@ -1,7 +1,7 @@
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_package_install = tplroot ~ ".package.install" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}

View File

@@ -4,8 +4,8 @@
Removes the build user and Go installation.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_file = tplroot ~ ".config.file" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
Go is absent for build user:

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#-
@@ -6,8 +5,8 @@
Required for building Chroma.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_file = tplroot ~ ".config.file" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
Gitea build user is present:

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#-
@@ -6,8 +5,8 @@
``grst`` script.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_file = tplroot ~ ".config.file" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{#-
@@ -9,9 +8,9 @@
Has a dependency on `gitea.go`_.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set sls_go_install = tplroot ~ '.go' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_file = tplroot ~ ".config.file" %}
{%- set sls_go_install = tplroot ~ ".go" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
@@ -60,9 +59,9 @@ Chroma is installed:
RST external renderer is installed:
file.managed:
- name: {{ gitea.lookup.mod_rst.path }}
- source: {{ files_switch(['grst'],
- source: {{ files_switch(["grst"],
use_subpath=True,
lookup='RST external renderer is installed'
lookup="RST external renderer is installed"
)
}}
- mode: '0755'

View File

@@ -5,8 +5,8 @@
Has a dependency on `gitea.config.clean`_.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_clean = tplroot ~ '.config.clean' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_clean = tplroot ~ ".config.clean" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
include:
@@ -17,8 +17,8 @@ Gitea package files are absent:
file.absent:
- names:
- {{ gitea.lookup.service.unit.format(name=gitea.lookup.service.name) }}
- {{ gitea.lookup.paths.bin | path_join('gitea') }}
{%- for p in ['conf', 'custom', 'log'] %}
- {{ gitea.lookup.paths.bin | path_join("gitea") }}
{%- for p in ["conf", "custom", "log"] %}
- {{ gitea.lookup.paths[p] }}
{%- endfor %}
# to make sure this can be installed again (onchanges req in package.installed)

View File

@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
@@ -112,7 +111,7 @@ Gitea binary is absent if verification failed:
Gitea directories are setup:
file.directory:
- names:
{%- for p in ['conf', 'work', 'custom', 'data', 'log', 'repos'] %}
{%- for p in ["conf", "work", "custom", "data", "log", "repos"] %}
- {{ gitea.lookup.paths[p] }}
{%- endfor %}
- makedirs: true
@@ -123,7 +122,7 @@ Gitea directories are setup:
Gitea binary is installed:
file.copy:
- name: {{ gitea.lookup.paths.bin | path_join('gitea') }}
- name: {{ gitea.lookup.paths.bin | path_join("gitea") }}
- source: /tmp/gitea-{{ gitea.version }}
# in case the version changed, overwrite previous binary
- force: true
@@ -141,15 +140,15 @@ Gitea service unit is available:
file.managed:
- name: {{ gitea.lookup.service.unit.format(name=gitea.lookup.service.name) }}
- source: {{ files_switch(
['gitea.service.j2'],
lookup='Gitea service unit is available',
["gitea.service.j2"],
lookup="Gitea service unit is available",
) }}
- template: jinja
- mode: '0644'
- user: root
- group: {{ gitea.lookup.rootgroup }}
- makedirs: true
- context: {{ {'gitea': gitea} | json }}
- context: {{ {"gitea": gitea} | json }}
- require:
- Gitea binary is installed
{%- if 'systemctl' | which %}

View File

@@ -1,4 +1,3 @@
{#- -*- coding: utf-8 -*- #}
{#- vim: ft=jinja #}
{#- If latest was specified, query the official download server for the latest version. -#}

View File

@@ -4,10 +4,10 @@
Stops the gitea service and disables it at boot time.
#}
{%- set tplroot = tpldir.split('/')[0] %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
Gitea is dead:
service.dead:
- name: {{ gitea.lookup.service.name }}
- enable: False
- enable: false

View File

@@ -1,7 +1,7 @@
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set tplroot = tpldir.split("/")[0] %}
{%- set sls_config_file = tplroot ~ ".config.file" %}
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
include:
@@ -10,7 +10,7 @@ include:
Gitea is running:
service.running:
- name: {{ gitea.lookup.service.name }}
- enable: True
- enable: true
- watch:
- sls: {{ sls_config_file }}
- Gitea binary is installed