.
This commit is contained in:
3
wifi-voucher/files/voucher.env.jinja
Normal file
3
wifi-voucher/files/voucher.env.jinja
Normal file
@@ -0,0 +1,3 @@
|
||||
{% for key, value in pillar['voucher']['config'].items() -%}
|
||||
{{ key }}="{{ value }}"
|
||||
{% endfor -%}
|
13
wifi-voucher/files/wifi-voucher.service
Normal file
13
wifi-voucher/files/wifi-voucher.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=WIFI-Voucher system for my guest network
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
User=voucher
|
||||
ExecStart=/usr/local/bin/voucher
|
||||
EnvironmentFile=/etc/default/wifi-voucher
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
4
wifi-voucher/init.sls
Normal file
4
wifi-voucher/init.sls
Normal file
@@ -0,0 +1,4 @@
|
||||
include:
|
||||
- wifi-voucher.packages
|
||||
- wifi-voucher.user
|
||||
- wifi-voucher.service
|
9
wifi-voucher/packages.sls
Normal file
9
wifi-voucher/packages.sls
Normal file
@@ -0,0 +1,9 @@
|
||||
Install CUPS and bsd tools:
|
||||
pkg.installed:
|
||||
- pkgs:
|
||||
- cups
|
||||
- cups-bsd
|
||||
|
||||
Install wifi-voucher:
|
||||
pip.installed:
|
||||
- name: https://git.rre.nu/jonas/wifi-voucher/raw/branch/main/dist/voucher-{{ pillar['voucher']['version'] }}-py39-none-any.whl
|
4
wifi-voucher/remove.sls
Normal file
4
wifi-voucher/remove.sls
Normal file
@@ -0,0 +1,4 @@
|
||||
remove voucher user:
|
||||
user.absent:
|
||||
- name: voucher
|
||||
- purge: True
|
31
wifi-voucher/service.sls
Normal file
31
wifi-voucher/service.sls
Normal file
@@ -0,0 +1,31 @@
|
||||
WIFI-Voucher Unit environment file:
|
||||
file.managed:
|
||||
- name: /etc/default/wifi-voucher
|
||||
- source: salt://wifi-voucher/files/voucher.env.jinja
|
||||
- template: jinja
|
||||
- user: root
|
||||
- group: voucher
|
||||
- mode: "0640"
|
||||
|
||||
WIFI-Voucher unit service file:
|
||||
file.managed:
|
||||
- name: /etc/systemd/system/wifi-voucher.service
|
||||
- source: salt://wifi-voucher/files/wifi-voucher.service
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: "0644"
|
||||
|
||||
SystemD Reload:
|
||||
cmd.run:
|
||||
- name: systemctl --system daemon-reload
|
||||
- onchanges:
|
||||
- file: WIFI-Voucher unit service file
|
||||
|
||||
Start wifi-voucher:
|
||||
service.running:
|
||||
- name: wifi-voucher
|
||||
- enable: True
|
||||
- watch:
|
||||
- file: WIFI-Voucher Unit environment file
|
||||
- file: WIFI-Voucher unit service file
|
||||
- cmd: SystemD Reload
|
8
wifi-voucher/user.sls
Normal file
8
wifi-voucher/user.sls
Normal file
@@ -0,0 +1,8 @@
|
||||
WIFI-Voucher user:
|
||||
user.present:
|
||||
- name: voucher
|
||||
- fullname: wifi-voucher system
|
||||
- home: /home/voucher
|
||||
- shell: /bin/bash
|
||||
- groups:
|
||||
- gpio
|
Reference in New Issue
Block a user