added pki state

This commit is contained in:
Paul 2020-11-30 22:28:24 +01:00
parent e753afd5e1
commit b2ec2328a8
4 changed files with 29 additions and 1 deletions

View File

@ -3,6 +3,7 @@ pki:
enabled: true
install_dir: /usr/local/apps
release_dir: /usr/local/apps/releases
port: 11000
mirror: https://git.paulbsd.com/paulbsd/pki/releases/download
version: 0.1.0
os: linux

View File

@ -1,3 +1,4 @@
---
include:
- .install
- .install
- .service

12
states/pki/pki.service.j2 Normal file
View File

@ -0,0 +1,12 @@
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
{%- from "pki/map.jinja" import pki with context %}
[Unit]
Description=PKI Let's encrypt database
After=network.target
[Service]
Type=simple
ExecStart={{ pki.install_dir }}/pki/pki -configfile {{ pki.install_dir }}/config/common.ini -port {{ pki.port }}
[Install]
WantedBy=multi-user.target

14
states/pki/service.sls Normal file
View File

@ -0,0 +1,14 @@
---
{%- from "pki/map.jinja" import pki with context %}
pki-service-file:
file.managed:
- name: /etc/systemd/system/pki.service
- source: salt://pki/pki.service.j2
- user: root
- group: root
- template: jinja
pki-service:
service.running:
- name: pki
- enable: true