1abe8743fc0e316d397a28e399f3fddf5daeae74
[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 ovs_set_manager:
9   cmd.run:
10   - name: "ovs-vsctl set-manager {{ client.ovsdb_server_iface }} {{ client.ovsdb_odl_iface }}"
11   - unless: "ovs-vsctl get-manager | fgrep -x {{ client.ovsdb_odl_iface }}"
12
13 ovs_set_tunnel_endpoint:
14   cmd.run:
15   - name: "ovs-vsctl set Open_vSwitch . other_config:local_ip={{ client.tunnel_ip }}"
16   - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep local_ip"
17   - require:
18     - cmd: ovs_set_manager
19
20 ovs_set_provider_mapping:
21   cmd.run:
22   - name: "ovs-vsctl set Open_vSwitch . other_config:provider_mappings={{ client.provider_mappings }}"
23   - unless: "ovs-vsctl get Open_vSwitch . other_config | fgrep provider_mappings"
24   - require:
25     - cmd: ovs_set_manager
26
27 {%- endif %}