Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F24683886
D3985.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D3985.diff
View Options
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,21 @@
+# -------------------------------------------------------------
+# Salt — Router — CARP
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+
+/etc/rc.conf:
+ file.blockreplace:
+ - marker_start: "#-- SALT CARP START --"
+ - marker_end: "#-- SALT CARP END --"
+ - source: salt://roles/router/carp/carp.jinja
+ - template: jinja
+
+reload_network:
+ cmd.run:
+ - name: service netif restart
+ - watch:
+ - file: /etc/rc.conf
+hsh
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Mar 6, 03:39 (15 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3500545
Default Alt Text
D3985.diff (2 KB)
Attached To
Mode
D3985: Add CARP configuration template and state
Attached
Detach File
Event Timeline
Log In to Comment