Page MenuHomeDevCentral

D1181.id3070.diff
No OneTemporary

D1181.id3070.diff

diff --git a/UIDs b/UIDs
--- a/UIDs
+++ b/UIDs
@@ -1,6 +1,7 @@
830 odderon
831 builder
832 chaton
+833 viper
9001 salt
9002 deploy
8900 zr
diff --git a/roles/viperserv/eggdrop/account.sls b/roles/viperserv/eggdrop/account.sls
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/eggdrop/account.sls
@@ -0,0 +1,40 @@
+# -------------------------------------------------------------
+# Salt — Deploy ViperServ (eggdrop)
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-14
+# Description: Eggdrop on Freenode
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# Service account
+# -------------------------------------------------------------
+
+viperserv_account:
+ user.present:
+ - name: viperserv
+ - fullname: ViperServ
+ - uid: 833
+ - gid: 829
+ - home: /var/run/viperserv
+
+/var/run/viperserv:
+ file.directory:
+ - user: 833
+ - group: 829
+ - dir_mode: 700
+
+# -------------------------------------------------------------
+# Sudo capabilities
+#
+# Members of nasqueron-irc should be able to sudo -u odderon …
+# -------------------------------------------------------------
+
+viperserv_sudo_capabilities_file:
+ file.managed:
+ - name: {{ dirs.etc }}/sudoers.d/viperserv
+ - source: salt://roles/viperserv/eggdrop/files/viperserv.sudoers
+ - template: jinja
diff --git a/roles/viperserv/eggdrop/files/viperserv.sudoers b/roles/viperserv/eggdrop/files/viperserv.sudoers
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/eggdrop/files/viperserv.sudoers
@@ -0,0 +1,24 @@
+# -------------------------------------------------------------
+# ViperServ
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-14
+# License: Trivial work, not eligible to copyright
+# Source file: roles/viperserv/eggdrop/files/viperserv.sudoers
+# -------------------------------------------------------------
+#
+# <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>
+
+%nasqueron-irc ALL=(viperserv) NOPASSWD: ALL
+
+# Service management
+{% for command in ["start", "stop", "restart"] %}
+%nasqueron-irc ALL= NOPASSWD: service viperserv {{ command }}
+%nasqueron-irc ALL= NOPASSWD: service viperserv one{{ command }}
+{% endfor %}
+%nasqueron-irc ALL= NOPASSWD: /usr/local/etc/rc.d/viperserv
diff --git a/roles/viperserv/eggdrop/init.sls b/roles/viperserv/eggdrop/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/eggdrop/init.sls
@@ -0,0 +1,11 @@
+# -------------------------------------------------------------
+# Salt — Deploy eggdrop park
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-05
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .account
+ - .software
diff --git a/roles/viperserv/eggdrop/software.sls b/roles/viperserv/eggdrop/software.sls
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/eggdrop/software.sls
@@ -0,0 +1,50 @@
+# -------------------------------------------------------------
+# Salt — Deploy eggdrop park
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-05
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% from "map.jinja" import dirs with context %}
+
+# -------------------------------------------------------------
+# Build eggdrop
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+eggdrop_software:
+ file.directory:
+ - name: /opt/eggdrop
+ - user: builder
+ - group: deployment
+ cmd.run:
+ - name: install-eggdrop
+ - runas: builder
+ - env:
+ - DEST: /opt/eggdrop
+ - creates: /opt/eggdrop/eggdrop
+
+{{ dirs.bin }}/eggdrop:
+ file.symlink:
+ - target: /opt/eggdrop/eggdrop
+ - require:
+ - cmd: eggdrop_software
+
+# -------------------------------------------------------------
+# ViperServ directory
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/srv/viperserv:
+ file.directory:
+ - user: viperserv
+ - group: nasqueron-irc
+ - dir_mode: 770
+
+viperserv_scripts:
+ git.latest:
+ - name: https://devcentral.nasqueron.org/source/viperserv.git
+ - target: /srv/viperserv/scripts
+ - update_head: False
+ - user: viperserv
+ - require:
+ - file: /srv/viperserv
diff --git a/roles/viperserv/init.sls b/roles/viperserv/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/init.sls
@@ -0,0 +1,19 @@
+# -------------------------------------------------------------
+# Salt — Deploy eggdrop park
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2017-11-05
+# License: Trivial work, not eligible to copyright
+# _ ___ _____
+# | | / (_)___ ___ _____/ ___/___ ______ __
+# | | / / / __ \/ _ \/ ___/\__ \/ _ \/ ___/ | / /
+# | |/ / / /_/ / __/ / ___/ / __/ / | |/ /
+# |___/_/ .___/\___/_/ /____/\___/_/ |___/
+# /_/
+#
+# [ 1993 technology for 2017 hackers ]
+#
+# -------------------------------------------------------------
+
+include:
+ - .eggdrop
diff --git a/top.sls b/top.sls
--- a/top.sls
+++ b/top.sls
@@ -23,6 +23,7 @@
- roles/paas-jails
- roles/dbserver-mysql
- roles/devserver
+ - roles/viperserv
- roles/webserver-core
- roles/webserver-legacy
- roles/webserver-varnish

File Metadata

Mime Type
text/plain
Expires
Wed, Nov 27, 01:38 (5 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2265570
Default Alt Text
D1181.id3070.diff (5 KB)

Event Timeline