summaryrefslogtreecommitdiffstats
path: root/mcp/salt-formulas/opendaylight/client.sls
diff options
context:
space:
mode:
authorMichael Polenchuk <mpolenchuk@mirantis.com>2017-06-27 12:52:39 +0400
committerMichael Polenchuk <mpolenchuk@mirantis.com>2017-06-29 16:35:25 +0400
commit3fb5e5454045860463a92c18d4d859967002e6fb (patch)
tree7a68c5868e2f29dd1b57794dea4ea0921a630c24 /mcp/salt-formulas/opendaylight/client.sls
parentcaad7b5e20d66fafb391a37f2bfefc2e654dad6c (diff)
Bring in opendaylight support
Change-Id: I2eed0cf19907f257be1cb4aee96528cc41f4843a Signed-off-by: Michael Polenchuk <mpolenchuk@mirantis.com>
Diffstat (limited to 'mcp/salt-formulas/opendaylight/client.sls')
-rw-r--r--mcp/salt-formulas/opendaylight/client.sls27
1 files changed, 27 insertions, 0 deletions
diff --git a/mcp/salt-formulas/opendaylight/client.sls b/mcp/salt-formulas/opendaylight/client.sls
new file mode 100644
index 000000000..1abe8743f
--- /dev/null
+++ b/mcp/salt-formulas/opendaylight/client.sls
@@ -0,0 +1,27 @@
+{%- from "opendaylight/map.jinja" import client with context %}
+{%- if client.get('enabled', True) %}
+
+opendaylight_client_packages:
+ pkg.installed:
+ - pkgs: {{ client.pkgs }}
+
+ovs_set_manager:
+ cmd.run:
+ - name: "ovs-vsctl set-manager {{ client.ovsdb_server_iface }} {{ client.ovsdb_odl_iface }}"
+ - unless: "ovs-vsctl get-manager | fgrep -x {{ client.ovsdb_odl_iface }}"
+
+ovs_set_tunnel_endpoint:
+ cmd.run:
+ - name: "ovs-vsctl set Open_vSwitch . other_config:local_ip={{ client.tunnel_ip }}"
+ - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep local_ip"
+ - require:
+ - cmd: ovs_set_manager
+
+ovs_set_provider_mapping:
+ cmd.run:
+ - name: "ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ client.provider_mappings }}"
+ - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep provider_mappings"
+ - require:
+ - cmd: ovs_set_manager
+
+{%- endif %}