feat: Update template
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
---
|
||||
{%- set tplroot = tpldir.split("/")[0] %}
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
*Meta-state*.
|
||||
|
||||
This state will undo everything performed in the ``gitea`` meta-state
|
||||
in reverse order, i.e.
|
||||
stops the service,
|
||||
removes the configuration file and then
|
||||
uninstalls the package.
|
||||
Some paths are left to avoid accidental data loss
|
||||
(namely ``GITEA_WORKDIR``, ``APP_DATA_PATH`` and the gitea user home).
|
||||
#}
|
||||
|
||||
include:
|
||||
- .service.clean
|
||||
- .config.clean
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will remove the configuration of the gitea service and has a
|
||||
dependency on ``gitea.service.clean`` via include list.
|
||||
#}
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
|
||||
@@ -8,7 +12,7 @@
|
||||
include:
|
||||
- {{ sls_service_clean }}
|
||||
|
||||
gitea-config-clean-file-absent:
|
||||
Gitea configuration is absent:
|
||||
file.absent:
|
||||
- names:
|
||||
- {{ gitea.lookup.paths.conf | path_join("app.ini") }}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
@@ -23,11 +22,11 @@ Gitea internal token file is generated:
|
||||
- sls: {{ sls_package_install }}
|
||||
{%- endif %}
|
||||
|
||||
Gitea config is setup:
|
||||
Gitea configuration is managed:
|
||||
file.managed:
|
||||
- name: {{ gitea.lookup.paths.conf | path_join('app.ini') }}
|
||||
- source: {{ files_switch(['app.ini.j2'],
|
||||
lookup='Gitea config is setup'
|
||||
- name: {{ gitea.lookup.paths.conf | path_join("app.ini") }}
|
||||
- source: {{ files_switch(["app.ini", "app.ini.j2"],
|
||||
lookup="Gitea configuration is managed"
|
||||
)
|
||||
}}
|
||||
- template: jinja
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will configure the gitea service
|
||||
and has a dependency on ``gitea.install`` via include list.
|
||||
#}
|
||||
|
||||
include:
|
||||
- .file
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
*Meta-state*.
|
||||
|
||||
This installs the gitea package,
|
||||
manages the gitea configuration file
|
||||
and then starts the associated gitea service.
|
||||
#}
|
||||
|
||||
include:
|
||||
- .package
|
||||
- .config
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{#- -*- coding: utf-8 -*- #}
|
||||
{#- vim: ft=jinja #}
|
||||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{#- -*- coding: utf-8 -*- #}
|
||||
{#- vim: ft=jinja #}
|
||||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{#- -*- coding: utf-8 -*- #}
|
||||
{#- vim: ft=jinja #}
|
||||
|
||||
{#- Get the relevant values from the `opts` dict #}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
{#- -*- coding: utf-8 -*- #}
|
||||
{#- vim: ft=jinja #}
|
||||
|
||||
{#- Get the `tplroot` from `tpldir` #}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will remove the gitea package and has a depency on
|
||||
``gitea.config.clean`` via include list.
|
||||
#}
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- set sls_config_clean = tplroot ~ '.config.clean' %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will install the gitea package only.
|
||||
#}
|
||||
|
||||
include:
|
||||
- .install
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set default values.
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=yaml
|
||||
#
|
||||
# Set values specific to:
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will stop the gitea service and disable it at boot time.
|
||||
#}
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
{%- from tplroot ~ "/map.jinja" import mapdata as gitea with context %}
|
||||
|
||||
gitea-service-clean-service-dead:
|
||||
Gitea is dead:
|
||||
service.dead:
|
||||
- name: {{ gitea.lookup.service.name }}
|
||||
- enable: False
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{#-
|
||||
This state will start the gitea service
|
||||
and has a dependency on ``gitea.config`` via include list.
|
||||
#}
|
||||
|
||||
include:
|
||||
- .running
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# vim: ft=sls
|
||||
|
||||
{%- set tplroot = tpldir.split('/')[0] %}
|
||||
@@ -8,7 +7,7 @@
|
||||
include:
|
||||
- {{ sls_config_file }}
|
||||
|
||||
gitea-service-running-service-running:
|
||||
Gitea is running:
|
||||
service.running:
|
||||
- name: {{ gitea.lookup.service.name }}
|
||||
- enable: True
|
||||
|
||||
Reference in New Issue
Block a user