summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Rozet <trozet@redhat.com>2017-03-09 16:18:43 -0500
committerTim Rozet <trozet@redhat.com>2017-03-09 16:45:58 -0500
commitbb2d937d418b9353fd6f294978c23f5908d2e366 (patch)
tree9fbff60477694425fc84d31e9f66c362244e2623
parentac2d7693e02a11d80879ccd80dc33a4f213295e6 (diff)
Restarts honeycomb after mounting
Currently after mounting VPP into ODL, a restart to honeycomb is required to initiate a new connection to ODL. This change ensures honeycomb is restarted after nodes are mounted. It also includes a check to make sure after honeycomb comes back up, the VPP node is actually mounted correctly into ODL's operational datastore. Change-Id: I92ea36cdd5de906cabd010e6c3a09a1f891eb94b Signed-off-by: Tim Rozet <trozet@redhat.com>
-rw-r--r--manifests/honeycomb.pp15
1 files changed, 12 insertions, 3 deletions
diff --git a/manifests/honeycomb.pp b/manifests/honeycomb.pp
index 07923d5..e517e51 100644
--- a/manifests/honeycomb.pp
+++ b/manifests/honeycomb.pp
@@ -81,16 +81,25 @@ class fdio::honeycomb (
if !empty($opendaylight_ip) {
validate_ip_address($opendaylight_ip)
-
+ $odl_url = "http://${opendaylight_ip}:${opendaylight_port}"
$fdio_data = "{'node' : [{'node-id':'${node_id}','netconf-node-topology:host':'${bind_ip}','netconf-node-topology:port':'2831','netconf-node-topology:tcp-only':false,'netconf-node-topology:keepalive-delay':0,'netconf-node-topology:username':'${opendaylight_username}','netconf-node-topology:password':'${opendaylight_password}','netconf-node-topology:connection-timeout-millis':10000,'netconf-node-topology:default-request-timeout-millis':10000,'netconf-node-topology:max-connection-attempts':10,'netconf-node-topology:between-attempts-timeout-millis':10000,'netconf-node-topology:schema-cache-directory':'hcmount'}]}"
- $fdio_url = "http://${opendaylight_ip}:${opendaylight_port}/restconf/config/network-topology:network-topology/network-topology:topology/topology-netconf/node/${node_id}"
+ $fdio_url = "${odl_url}/restconf/config/network-topology:network-topology/network-topology:topology/topology-netconf/node/${node_id}"
+ $oper_mount_url = "${odl_url}/restconf/operational/renderer:renderers"
exec { 'VPP Mount into ODL':
command => "curl -o /dev/null --fail --silent -u ${opendaylight_username}:${opendaylight_password} ${fdio_url} -i -H 'Content-Type: application/json' --data \"${fdio_data}\" -X PUT",
tries => 5,
try_sleep => 30,
path => '/usr/sbin:/usr/bin:/sbin:/bin',
- require => Service['honeycomb'],
+ notify => Service['honeycomb'],
+ }
+
+ exec { 'Check VPP was mounted into ODL operational DS':
+ command => "curl --fail -u ${opendaylight_username}:${opendaylight_password} ${oper_mount_url} | grep ${node_id}",
+ tries => 5,
+ try_sleep => 30,
+ path => '/usr/sbin:/usr/bin:/sbin:/bin',
+ subscribe => Service['honeycomb'],
}
}
}