Page MenuHomeDevCentral

D4036.diff
No OneTemporary

D4036.diff

diff --git a/roles/router/carp/files/newsyslog.conf b/roles/router/carp/files/newsyslog.conf
new file mode 100644
--- /dev/null
+++ b/roles/router/carp/files/newsyslog.conf
@@ -0,0 +1,16 @@
+# -------------------------------------------------------------
+# Salt — CARP newsyslog
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/router/carp/files/newsyslog.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>
+
+/var/log/carp.log root:wheel 644 7 1000 * JC
diff --git a/roles/router/carp/files/syslog.conf b/roles/router/carp/files/syslog.conf
new file mode 100644
--- /dev/null
+++ b/roles/router/carp/files/syslog.conf
@@ -0,0 +1,18 @@
+# -------------------------------------------------------------
+# Salt — CARP syslog
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# Source file: roles/router/carp/files/syslog.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>
+
+!carp-ovh
+*.* /var/log/carp.log
+!*
diff --git a/roles/router/carp/init.sls b/roles/router/carp/init.sls
--- a/roles/router/carp/init.sls
+++ b/roles/router/carp/init.sls
@@ -40,3 +40,28 @@
vault:
approle: {{ salt["credentials.read_secret"]("network/router/vault") }}
addr: {{ pillar["nasqueron_services"]["vault_url"] }}
+
+/var/log/carp.log:
+ file.managed:
+ - mode: 644
+
+/usr/local/etc/syslog.d/carp.conf:
+ file.managed:
+ - source: salt://roles/router/carp/files/syslog.conf
+ - mode: 644
+ - makedirs: True
+
+/etc/newsyslog.conf.d/carp.conf:
+ file.managed:
+ - source: salt://roles/router/carp/files/newsyslog.conf
+ - mode: 644
+
+/etc/syslog.conf:
+ file.replace:
+ - pattern: '^\*\.notice;authpriv\.none;kern\.debug;lpr\.info;mail\.crit;news\.err\s+/var/log/messages$'
+ - repl: '!-carp-ovh\n*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages\n!*'
+ - flags:
+ - MULTILINE
+ - count: 1
+ - backup: False
+ - unless: grep -Fqx '!-carp-ovh' /etc/syslog.conf

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 23:07 (22 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3591740
Default Alt Text
D4036.diff (2 KB)

Event Timeline