gitea config

This commit is contained in:
2019-03-30 20:18:01 -04:00
parent 401aa60a35
commit dc716f477c
5 changed files with 118 additions and 8 deletions

View File

@@ -4,11 +4,35 @@
%}
{% set basepath = salt.pillar.get('gitea:path') %}
wget {{ url }} -O {{ basepath }}/bin/gitea && chmod +x {{ basepath }}/bin/gitea && echo {{ ver }} > {{ basepath }}/VERSION:
'download gitea':
cmd.run:
- name: 'wget {{ url }} -O {{ basepath }}/bin/gitea && chmod +x {{ basepath }}/bin/gitea && echo {{ ver }} > {{ basepath }}/VERSION'
- unless: grep -P '^{{ ver }}$' {{ basepath }}/VERSION
- runas: {{ salt.pillar.get('gitea:user') }}
- require:
- sls: gitea.dirs
# need to setup etc/
{{basepath}}/etc/secrets.json:
file.managed:
- user: {{ salt.pillar.get('gitea:user') }}
- group: {{ salt.pillar.get('gitea:user') }}
- mode: 400
{% if not salt.file.contains(basepath + '/etc/secrets.json', 'INTERNAL_TOKEN') %}
- source: 'salt://gitea/files/secrets_json.jinja'
- template: jinja
{% else %}
- replace: False
{% endif %}
- require:
- cmd: download gitea
{{basepath}}/etc/app.ini:
file.managed:
- source: salt://gitea/files/app_ini.jinja
- template: jinja
- user: {{ salt.pillar.get('gitea:user') }}
- group: {{ salt.pillar.get('gitea:user') }}
- mode: 640
- require:
- file: {{basepath}}/etc/secrets.json