added initial state for rainloop

This commit is contained in:
Paul 2020-09-02 21:12:15 +02:00
parent b58d7e0b99
commit 822b9138b1
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
rainloop-config:

View File

@ -0,0 +1,11 @@
---
rainloop:
enabled: true
install_dir: /usr/local/apps
release_dir: /usr/local/apps/releases
#mirror: https://github.com/RainLoop/rainloop-webmail/releases/download/v1.14.0/rainloop-community-1.14.0.zip
mirror: https://github.com/RainLoop/rainloop-webmail/releases/download
version: 1.14.0
user: www-data
group: www-data
config: {}

5
states/rainloop/init.sls Normal file
View File

@ -0,0 +1,5 @@
---
include:
#- php
- .install
#- .config

View File

@ -0,0 +1,18 @@
---
{%- from "rainloop/map.jinja" import rainloop with context %}
rainloop-archive-extract:
archive.extracted:
- name: {{ rainloop.release_dir }}/rainloop-community-{{ rainloop.version }}
- source: {{ rainloop.mirror }}/v{{ rainloop.version }}/rainloop-community-{{ rainloop.version }}.zip
- skip_verify: true
- enforce_toplevel: false
- user: {{ rainloop.user }}
- group: {{ rainloop.group }}
- if_missing: {{ rainloop.release_dir }}/rainloop-community-{{ rainloop.version }}
rainloop-archive-symlink:
file.symlink:
- name: {{ rainloop.install_dir }}/rainloop
- target: {{ rainloop.release_dir }}/rainloop-community-{{ rainloop.version }}
- require:
- archive: rainloop-archive-extract

View File

@ -0,0 +1,5 @@
{%- import_yaml "rainloop/defaults.yaml" as default_settings -%}
{%- set defaults = salt['grains.filter_by'](default_settings, default='rainloop') -%}
{%- set rainloop = salt['pillar.get']('rainloop', default=defaults, merge=True) -%}