Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F28009351
D4101.id10740.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D4101.id10740.diff
View Options
diff --git a/roles/core/network/files/newsyslog_gre.conf b/roles/core/network/files/newsyslog_gre.conf
--- a/roles/core/network/files/newsyslog_gre.conf
+++ b/roles/core/network/files/newsyslog_gre.conf
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/router/carp/files/newsyslog.conf
+# Source file: roles/core/network/files/newsyslog_gre.conf
# -------------------------------------------------------------
#
# <auto-generated>
diff --git a/roles/core/network/files/syslog_gre.conf b/roles/core/network/files/syslog_gre.conf
--- a/roles/core/network/files/syslog_gre.conf
+++ b/roles/core/network/files/syslog_gre.conf
@@ -3,7 +3,7 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# License: Trivial work, not eligible to copyright
-# Source file: roles/router/carp/files/syslog.conf
+# Source file: roles/core/network/files/syslog_gre.conf
# -------------------------------------------------------------
#
# <auto-generated>
@@ -14,4 +14,5 @@
# </auto-generated>
!gre-tunnels
-*.* /var/log/gre-tunnels.log
+*.* /var/log/gre-tunnels.log
+!*
diff --git a/roles/core/network/gre_logging.sls b/roles/core/network/gre_logging.sls
--- a/roles/core/network/gre_logging.sls
+++ b/roles/core/network/gre_logging.sls
@@ -1,19 +1,50 @@
+# -------------------------------------------------------------
+# Salt — Network — GRE tunnels log
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set roles = grains.get("roles", []) %}
+
+{% if "router" in roles or "devserver" in roles %}
+
/usr/local/etc/syslog.d/gre-tunnels.conf:
file.managed:
- - source: salt://roles/core/network/files/FreeBSD/syslog_gre.conf
+ - source: salt://roles/core/network/files/syslog_gre.conf
- user: root
- group: wheel
- mode: 644
/etc/newsyslog.conf.d/gre-tunnels.conf:
file.managed:
- - source: salt://roles/core/network/files/FreeBSD/newsyslog_gre.conf
+ - source: salt://roles/core/network/files/newsyslog_gre.conf
- user: root
- group: wheel
- mode: 644
-reload_syslogd_for_gre_logs:
- cmd.run:
- - name: service syslogd reload
- - onchanges:
- - file: /usr/local/etc/syslog.d/gre-tunnels.conf
+/etc/syslog.conf add gre next to carp:
+ file.replace:
+ - name: /etc/syslog.conf
+ - pattern: '^!-carp-ovh\n\*\.notice;authpriv\.none;kern\.debug;lpr\.info;mail\.crit;news\.err\s+/var/log/messages\n!\*$'
+ - repl: '!-carp-ovh,gre-tunnels\n*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages\n!*'
+ - flags:
+ - MULTILINE
+ - count: 1
+ - backup: False
+ - onlyif: grep -Fqx '!-carp-ovh' /etc/syslog.conf
+ - unless: grep -Fqx '!-carp-ovh,gre-tunnels' /etc/syslog.conf
+
+/etc/syslog.conf exclude gre:
+ file.replace:
+ - name: /etc/syslog.conf
+ - pattern: '^\*\.notice;authpriv\.none;kern\.debug;lpr\.info;mail\.crit;news\.err\s+/var/log/messages$'
+ - repl: '!-gre-tunnels\n*.notice;authpriv.none;kern.debug;lpr.info;mail.crit;news.err /var/log/messages\n!*'
+ - flags:
+ - MULTILINE
+ - count: 1
+ - backup: False
+ - onlyif: test "$(grep -Fxc '!-carp-ovh' /etc/syslog.conf)" = "0"
+ - unless: grep -Eq '^!-(carp-ovh,gre-tunnels|gre-tunnels,carp-ovh|gre-tunnels)$' /etc/syslog.conf
+
+{% endif %}
diff --git a/roles/core/network/init.sls b/roles/core/network/init.sls
--- a/roles/core/network/init.sls
+++ b/roles/core/network/init.sls
@@ -12,6 +12,7 @@
- .ipv6_fixes
- .dhclient6
- .gre
+ - .gre_logging
- .routes
# Drake can be configured as:
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
@@ -66,4 +66,4 @@
- MULTILINE
- count: 1
- backup: False
- - unless: grep -Fqx '!-carp-ovh' /etc/syslog.conf
+ - unless: grep -Eq '^!-(carp-ovh|carp-ovh,gre-tunnels|gre-tunnels,carp-ovh)$' /etc/syslog.conf
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, May 10, 13:42 (5 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3697849
Default Alt Text
D4101.id10740.diff (4 KB)
Attached To
Mode
D4101: Update GRE tunnels syslog configuration
Attached
Detach File
Event Timeline
Log In to Comment