diff options
Diffstat (limited to 'manifests/honeycomb.pp')
-rw-r--r-- | manifests/honeycomb.pp | 53 |
1 files changed, 49 insertions, 4 deletions
diff --git a/manifests/honeycomb.pp b/manifests/honeycomb.pp index 3d28179..ccad9ca 100644 --- a/manifests/honeycomb.pp +++ b/manifests/honeycomb.pp @@ -3,6 +3,22 @@ # OpenDaylight Honeycomb Agent # # === Parameters: +# [*opendaylight_ip*] +# (optional) Opendaylight server IP used to bind VPP to Opendaylight. +# Defaults to '' +# +# [*opendaylight_port*] +# (optional) Opendaylight server Port. +# Defaults to '8081' +# +# [*opendaylight_username*] +# (optional) Opendaylight server user name. +# Defaults to 'admin' +# +# [*opendaylight_password*] +# (optional) Opendaylight server password. +# Defaults to 'admin' +# # [*rest_port*] # Port for Honeycomb REST interface to listen on. # @@ -15,12 +31,27 @@ # [*password*] # Password to configure in honeycomb. # +# [*bind_ip*] +# (optional) Honeycomb service binding IP +# Defaults to '127.0.0.1' +# +# [*node_id*] +# (optional) Node ID for binding VPP to Opendaylight +# Defaults to $::fqdn +# class fdio::honeycomb ( - $rest_port = '8181', - $websocket_rest_port = '7779', - $user = 'admin', - $password = 'admin', + $opendaylight_ip = '', + $opendaylight_port = '8081', + $opendaylight_username = 'admin', + $opendaylight_password = 'admin', + $rest_port = '8181', + $websocket_rest_port = '7779', + $user = 'admin', + $password = 'admin', + $bind_ip = '127.0.0.1', + $node_id = $::fqdn, ) { + include ::fdio package { 'honeycomb': @@ -48,4 +79,18 @@ class fdio::honeycomb ( restart => 'systemctl stop vpp;systemctl stop honeycomb;rm -rf /var/lib/honeycomb/persist/*;systemctl start vpp; sleep 5;systemctl start honeycomb', } + if !empty($opendaylight_ip) { + validate_ip_address($opendaylight_ip) + + $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}" + + 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'], + } + } } |