aboutsummaryrefslogtreecommitdiffstats
path: root/mcp/config/states/opendaylight
blob: ae25ffcf4c6d58241cfeaf2800e2cd4bf81920af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash -e
##############################################################################
# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################

CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x

# shellcheck disable=SC1090
source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/lib.sh"

# Get OpenDaylight server options with prefix odl_
function odl() {
  salt --out txt -I 'opendaylight:server' pillar.get "opendaylight:server:odl_$1" | cut -d ' ' -f2
}

salt -I 'opendaylight:server' state.sls opendaylight
wait_for 20 "salt --out yaml -C 'I@neutron:server and *01*' network.connect $(odl bind_ip) $(odl rest_port) | fgrep -q 'result: true'"
salt -I 'opendaylight:server' service.restart opendaylight

# settle down neutron api and agents
sleep 180