aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/honeycomb.pp
diff options
context:
space:
mode:
authorFeng Pan <fpan@redhat.com>2017-04-28 17:35:57 -0400
committerFeng Pan <fpan@redhat.com>2017-05-02 17:22:42 -0400
commit4a9d6b863d1c77af21a1c5ea278c8cba3386a45f (patch)
tree41cb6d6d48e3117fe713b08c286bc2194be4c444 /manifests/honeycomb.pp
parenta789a040563bb27e591bea0c7ab504d379a4825c (diff)
Add support for interface role mapping
Change-Id: I88a01914304f5e32840810c03646d9cda1ae7fff Signed-off-by: Feng Pan <fpan@redhat.com>
Diffstat (limited to 'manifests/honeycomb.pp')
-rw-r--r--manifests/honeycomb.pp27
1 files changed, 23 insertions, 4 deletions
diff --git a/manifests/honeycomb.pp b/manifests/honeycomb.pp
index 6ea88b5..25739f2 100644
--- a/manifests/honeycomb.pp
+++ b/manifests/honeycomb.pp
@@ -39,6 +39,14 @@
# (optional) Node ID for binding VPP to Opendaylight
# Defaults to $::fqdn
#
+# [*interface_role_map*]
+# (optional) List of interface role mapping in the format
+# of <VPP interface name>:<role name>
+# Example:
+# [ 'GigabitEthernet0/5/0:public-interface',
+# 'GigabitEthernet0/6/0:tenant-interface' ]
+# Defaults to undef
+#
class fdio::honeycomb (
$opendaylight_ip = '',
$opendaylight_port = '8081',
@@ -50,8 +58,11 @@ class fdio::honeycomb (
$password = 'admin',
$bind_ip = '127.0.0.1',
$node_id = $::fqdn,
+ $interface_role_map = [],
) {
+ validate_array($interface_role_map)
+
include ::fdio
package { 'honeycomb':
@@ -91,15 +102,23 @@ class fdio::honeycomb (
tries => 5,
try_sleep => 30,
path => '/usr/sbin:/usr/bin:/sbin:/bin',
- notify => Service['honeycomb'],
- }
-
+ require => 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'],
+ }
+
+ if !empty($interface_role_map) {
+ configure_role_mappings { $interface_role_map:
+ honeycomb_username => $user,
+ honeycomb_password => $password,
+ honeycomb_url => "http://${bind_ip}:${rest_port}",
+ require => Service['honeycomb'],
+ before => Exec['VPP Mount into ODL'],
+ }
}
}
}