Merge "mcp/deploy/scripts: Move to git submodule"
[fuel.git] / mcp / salt-formulas / opendaylight / client.sls
1 {%- from "opendaylight/map.jinja" import client with context %}
2 {%- if client.get('enabled', True) %}
3
4 opendaylight_client_packages:
5   pkg.installed:
6   - pkgs: {{ client.pkgs }}
7
8 {%- if pillar.linux.network.bridge is defined and pillar.linux.network.bridge == 'openvswitch' %}
9 ovs_set_manager:
10   cmd.run:
11   - name: "ovs-vsctl set-manager {{ client.ovsdb_server_iface }} {{ client.ovsdb_odl_iface }}"
12   - unless: "ovs-vsctl get-manager | fgrep -x {{ client.ovsdb_odl_iface }}"
13
14 ovs_set_tunnel_endpoint:
15   cmd.run:
16   - name: "ovs-vsctl set Open_vSwitch . other_config:local_ip={{ client.tunnel_ip }}"
17   - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep local_ip"
18   - require:
19     - cmd: ovs_set_manager
20
21 {%- if client.provider_mappings is defined %}
22 ovs_set_provider_mapping:
23   cmd.run:
24   - name: "ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ client.provider_mappings }}"
25   - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep provider_mappings"
26   - require:
27     - cmd: ovs_set_manager
28 {%- endif %}
29
30 {%- endif %}
31 {%- endif %}