Page MenuHomeDevCentral

D1214.id3122.diff
No OneTemporary

D1214.id3122.diff

diff --git a/roles/viperserv/eggdrop/config.sls b/roles/viperserv/eggdrop/config.sls
--- a/roles/viperserv/eggdrop/config.sls
+++ b/roles/viperserv/eggdrop/config.sls
@@ -46,6 +46,14 @@
- user: viperserv
- group: nasqueron-irc
+/srv/viperserv/.credentials:
+ file.managed:
+ - source: salt://roles/viperserv/eggdrop/files/dot.credentials
+ - user: viperserv
+ - group: nasqueron-irc
+ - replace: False
+ - mode: 660
+
{% for botname, bot in pillar['viperserv_bots'].iteritems() %}
/srv/viperserv/{{ botname }}/eggdrop.conf:
diff --git a/roles/viperserv/eggdrop/files/dot.credentials b/roles/viperserv/eggdrop/files/dot.credentials
new file mode 100644
--- /dev/null
+++ b/roles/viperserv/eggdrop/files/dot.credentials
@@ -0,0 +1,21 @@
+# -------------------------------------------------------------
+# Eggdrop configuration file
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+#
+# _ ___ _____
+# | | / (_)___ ___ _____/ ___/___ ______ __
+# | | / / / __ \/ _ \/ ___/\__ \/ _ \/ ___/ | / /
+# | |/ / / /_/ / __/ / ___/ / __/ / | |/ /
+# |___/_/ .___/\___/_/ /____/\___/_/ |___/
+# /_/
+#
+# [ 1993 technology for 2017 hackers ]
+#
+# -------------------------------------------------------------
+
+set sql(host) localhost
+set sql(user) someuser
+set sql(pass) somepass
+set sql(database) Nasqueron
+
+die "Please configure MySQL credentials in /srv/viperserv/.credentials"
diff --git a/roles/viperserv/eggdrop/files/eggdrop-bot.conf b/roles/viperserv/eggdrop/files/eggdrop-bot.conf
--- a/roles/viperserv/eggdrop/files/eggdrop-bot.conf
+++ b/roles/viperserv/eggdrop/files/eggdrop-bot.conf
@@ -53,6 +53,12 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
load lib/fbsql.so
+source .credentials
+
+sql connect $sql(host) $sql(user) $sql(pass)
+sql2 connect $sql(host) $sql(user) $sql(pass)
+sql selectdb $sql(database)
+sql2 selectdb $sql(database)
# -------------------------------------------------------------
# Eggdrop modules

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 24, 06:37 (10 h, 29 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259338
Default Alt Text
D1214.id3122.diff (2 KB)

Event Timeline