Page MenuHomeDevCentral

D3986.diff
No OneTemporary

D3986.diff

diff --git a/pillar/credentials/vault.sls b/pillar/credentials/vault.sls
--- a/pillar/credentials/vault.sls
+++ b/pillar/credentials/vault.sls
@@ -250,6 +250,10 @@
reports:
- ops/secrets/nasqueron/rhyne-wyse/vault
+ router:
+ - ops/secrets/network/carp/1
+ - ops/secrets/network/carp/2
+
saas-mediawiki:
- ops/secrets/dbserver/cluster-B/users/saas-mediawiki
- ops/secrets/dbserver/cluster-B/users/saas-mw-deploy
diff --git a/roles/router/carp/carp.jinja b/roles/router/carp/carp.jinja
new file mode 100644
--- /dev/null
+++ b/roles/router/carp/carp.jinja
@@ -0,0 +1,29 @@
+# -------------------------------------------------------------
+# Salt — Network
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Interface configuration by OS/distro
+#
+# config_path: the configuration file to write in OS
+# source_path: in this repo, roles/core/network/files/<source_path>
+#
+# Don't set default value, so we MUST define them
+# for EACH os/distro.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+{% set carp_entries = salt['node.get_carp_entries']() %}
+
+{% for entry in carp_entries %}
+
+{% set carp_pass = salt['credentials.get_password']('ops/secrets/network/carp/' ~ entry.vhid) %}
+{% set prefix = 27 if entry.device == 'vmx0' else 32 %}
+
+ifconfig_{{ entry.device }}_alias0="inet vhid {{ entry.vhid }} advskew {{ entry.advskew }} pass {{ carp_pass }} alias {{ entry.vip }}/{{ prefix }}"
+
+{% endfor %}
+
diff --git a/roles/router/carp/carp.sls b/roles/router/carp/carp.sls
new file mode 100644
--- /dev/null
+++ b/roles/router/carp/carp.sls
@@ -0,0 +1,13 @@
+# -------------------------------------------------------------
+# Salt — Router — CARP
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+
+/etc/rc.conf.d/netif/carp:
+ file.managed:
+ - source: salt://roles/router/carp/carp.jinja
+ - template: jinja
+ - mode: '0644'
diff --git a/roles/router/init.sls b/roles/router/init.sls
new file mode 100644
--- /dev/null
+++ b/roles/router/init.sls
@@ -0,0 +1,9 @@
+# -------------------------------------------------------------
+# Salt — Router
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+include:
+ - .carp

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 3, 19:13 (22 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3492281
Default Alt Text
D3986.diff (2 KB)

Event Timeline