Page MenuHomeDevCentral

D3698.id9565.diff
No OneTemporary

D3698.id9565.diff

diff --git a/roles/reports/init.sls b/roles/reports/init.sls
--- a/roles/reports/init.sls
+++ b/roles/reports/init.sls
@@ -7,3 +7,4 @@
include:
- .reports
+ - .rhyne-wyse
diff --git a/roles/reports/init.sls b/roles/reports/rhyne-wyse/account.sls
copy from roles/reports/init.sls
copy to roles/reports/rhyne-wyse/account.sls
--- a/roles/reports/init.sls
+++ b/roles/reports/rhyne-wyse/account.sls
@@ -5,5 +5,18 @@
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
-include:
- - .reports
+rhyne_wyse_user:
+ user.present:
+ - name: rhyne-wyse
+ - shell: /bin/sh
+ - groups:
+ - nasquenautes
+ - system: True
+
+/var/run/rhyne-wyse:
+ file.directory:
+ - user: rhyne-wyse
+ - group: nasquenautes
+ - mode: 770
+ - require:
+ user: rhyne_wyse_user
diff --git a/roles/reports/rhyne-wyse/config.sls b/roles/reports/rhyne-wyse/config.sls
new file mode 100644
--- /dev/null
+++ b/roles/reports/rhyne-wyse/config.sls
@@ -0,0 +1,26 @@
+# -------------------------------------------------------------
+# Salt — Nasqueron Reports
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/usr/local/etc/secrets/rhyne-wise.yaml:
+ file.managed:
+ - source: salt://roles/reports/rhyne-wyse/files/secrets.conf
+ - template: jinja
+ - context:
+ vault:
+ approle: {{ salt["credentials.read_secret"]("nasqueron/rhyne-wyse/salt") }}
+ addr: {{ pillar["nasqueron_services"]["vault_url"] }}
+
+/var/db/rhyne-wyse:
+ file.directory:
+ - user: rhyne-wyse
+ - group: nasquenautes
+ - mode: 775
+ - recurse: True
diff --git a/roles/reports/rhyne-wyse/files/rhyne-wyse.cron b/roles/reports/rhyne-wyse/files/rhyne-wyse.cron
new file mode 100644
--- /dev/null
+++ b/roles/reports/rhyne-wyse/files/rhyne-wyse.cron
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Rhyne-Wyse crontab
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/reports/rhyne-wyse/files/rhyne-wyse.cron
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+MAILTO=ops@nasqueron.org
+
+02 15 * * * rhyne-wyse /usr/local/bin/rhyne-wyse
diff --git a/roles/reports/rhyne-wyse/files/rhyne-wyse.sh b/roles/reports/rhyne-wyse/files/rhyne-wyse.sh
new file mode 100755
--- /dev/null
+++ b/roles/reports/rhyne-wyse/files/rhyne-wyse.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# -------------------------------------------------------------
+# Rhyne-Wyse
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/reports/rhyne-wyse/files/rhyne-wyse.sh
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+set -e
+
+LOG=/var/log/rhyne-wyse.log
+WORKDIR=/var/run/rhyne-wyse
+
+# -------------------------------------------------------------
+# Task :: update Agora reports
+#
+# Logging is configured at bot level to output to stderr
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+cd $WORKDIR
+
+. /opt/rhyne-wise/venv/bin/activate
+update-agora-reports >> $LOG 2>&1
diff --git a/roles/reports/rhyne-wyse/files/secrets.conf b/roles/reports/rhyne-wyse/files/secrets.conf
new file mode 100644
--- /dev/null
+++ b/roles/reports/rhyne-wyse/files/secrets.conf
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# Rhyne-Wyse :: Vault configuration
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: BSD-2-Clause
+# Source file: roles/reports/rhyne-wyse/files/secrets.conf
+# Format: secretsmith
+# -------------------------------------------------------------
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+vault:
+ server:
+ url: {{ vault.addr }}
+ verify: /usr/local/share/certs/nasqueron-vault-ca.crt
+
+ auth:
+ method: approle
+ role_id: {{ vault.approle.role_id }}
+ secret_id: {{ vault.approle.secret_id }}
diff --git a/roles/reports/rhyne-wyse/files/syslog/rhyne-wyse.conf b/roles/reports/rhyne-wyse/files/syslog/rhyne-wyse.conf
new file mode 100644
--- /dev/null
+++ b/roles/reports/rhyne-wyse/files/syslog/rhyne-wyse.conf
@@ -0,0 +1,17 @@
+# -------------------------------------------------------------
+# Rhyne-Wyse newsyslog config
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/reports/rhyne-wyse/files/syslog/rhyne-wyse.conf
+# -------------------------------------------------------------
+#
+# <auto-generated>
+# This file is managed by our rOPS SaltStack repository.
+#
+# Changes to this file may cause incorrect behavior
+# and will be lost if the state is redeployed.
+# </auto-generated>
+
+# logfilename [owner:group] mode count size when flags
+/var/log/rhyne-wyse.log rhyne-wyse:nasquenautes 664 90 * @T00 BC
diff --git a/roles/reports/init.sls b/roles/reports/rhyne-wyse/init.sls
copy from roles/reports/init.sls
copy to roles/reports/rhyne-wyse/init.sls
--- a/roles/reports/init.sls
+++ b/roles/reports/rhyne-wyse/init.sls
@@ -6,4 +6,7 @@
# -------------------------------------------------------------
include:
- - .reports
+ - .account
+ - .software
+ - .config
+ - .service
diff --git a/roles/reports/rhyne-wyse/service.sls b/roles/reports/rhyne-wyse/service.sls
new file mode 100644
--- /dev/null
+++ b/roles/reports/rhyne-wyse/service.sls
@@ -0,0 +1,51 @@
+# -------------------------------------------------------------
+# Salt — Nasqueron Reports
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import services with context %}
+
+# -------------------------------------------------------------
+# Wrapper to call the service
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+# Virtual environment in /opt/rhyne-wise/venv
+
+rhyne_wyse_venv:
+ cmd.run:
+ - name: |
+ python3 -m venv /opt/rhyne-wyse/venv
+ . /opt/rhyne-wyse/venv/bin/activate
+ pip install /opt/nasqueron-reports/dist/nasqueron_reports-0.0.0.dev0-py3-none-any.whl
+ pip install -r /opt/nasqueron-reports/tools/rhyne-wyse/requirements.txt
+
+ - creates: /opt/rhyne-wyse/venv/bin/activate
+
+/usr/local/bin/rhyne-wyse:
+ file.managed:
+ - source: salt://roles/reports/rhyne-wyse/files/rhyne-wyse.sh
+ - mode: 755
+
+# -------------------------------------------------------------
+# Log
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/usr/local/etc/newsyslog.conf.d/rhyne-wyse.conf:
+ file.managed:
+ - source: salt://roles/reports/rhyne-wyse/files/syslog/rhyne-wyse.conf
+
+rhyne_wyse_newsyslog_run:
+ cmd.run:
+ - name: newsyslog -NC
+ - creates: /var/log/rhyne-wyse.log
+
+# -------------------------------------------------------------
+# Cron
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/usr/local/etc/cron.d/rhyne-wyse:
+ file.managed:
+ - source: salt://roles/reports/rhyne-wyse/files/rhyne-wyse.cron
+ - makedirs: True
diff --git a/roles/reports/rhyne-wyse/software.sls b/roles/reports/rhyne-wyse/software.sls
new file mode 100644

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 22, 15:57 (16 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3004178
Default Alt Text
D3698.id9565.diff (8 KB)

Event Timeline