exabgp cookbook

安装和配置 exabgp 的 Chef “烹饪” 手册。「Chef cookbook to install and configure exabgp」

  • 所有者: criteo-cookbooks/chef-exabgp
  • 平台:
  • 许可证: Apache License 2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

exabgp cookbook

Installs and configures ExaBGP
the swiss-army knife of networking.

DEPRECATION NOTICE

After careful consideration, we are making this the last release of the ExaBGP cookbook as we found implementing implementing simple package, service, and template resources in our internal cookbooks easier and less time consuming than building a complex set of wrappers around ExaBGP's configuration. Supporting pip and source installations is also a lot more maintenance cost than value for very special use cases.

We are leaving this cookbook up for adoption; If anyone wishes to continue supporting it email support@dnsimple.com.

For a basic example of installing and setting up a package based ExaBGP, here is one:

The Chef recipe

package 'exabgp'

template '/etc/exabgp/exabgp.conf' do
  user 'exabgp'
  group 'exabgp'
  variables(my_as: node['mycorp']['as_number'])
  notifies :reload, 'service[exabgp]'
end

cookbook_file '/etc/exabgp/watchdog.sh' do
  user 'exabgp'
  group 'exabgp'
  mode '755'
  notifies :reload, 'service[exabgp]'
end

service 'exabgp' do
  supports reload: true, status: true
  action :nothing
end

The exabgp.conf template

process announce-routes {
	run ./watchdog.sh;
}

neighbor 127.0.0.1 {
	router-id 1.2.3.4;
	local-address 127.0.0.1;
	local-as <%= @my_as %>;
	peer-as 1;
	group-updates false;

	capability {
		graceful-restart;
	}

	api {
		processes [ announce-routes ];
	}
}

The watchdog.sh script:

#!/bin/sh

# ignore Control C
# if the user ^C exabgp we will get that signal too, ignore it and let exabgp send us a SIGTERM
trap '' SIGINT

# command and watchdog name are case sensitive

while `true`;
do

# Let give exabgp the time to setup the BGP session :)
# But we do not have too, exabgp will record the changes and update the routes once up otherwise

sleep 10

# without name exabgp will use the name of the service as watchdog name
echo "withdraw watchdog"
sleep 5

# specify a watchdog name (which may be the same or different each time)
echo "withdraw watchdog watchdog-one"
sleep 5

echo "announce watchdog"
sleep 5

echo "announce watchdog watchdog-one"
sleep 5

# we have no route with that watchdog but it does not matter, we could have after a configuration reload

echo "announce watchdog watchdog-two"
echo "withdraw watchdog watchdog-two"

done

Supported Chef and Platforms

  • Chef 12.6 and newer

  • Ubuntu 14.04 and newer

Dependencies

  • poise-python (for package installation)
  • git (for source installation)

Attributes

Attribute Description Default Value
node['exabgp']['package_version'] Version of the python package to install 3.4.19
node['exabgp']['bin_path'] Location of the ExaBGP binary, only set on source installations /usr/sec/exabgp/sbin/exabgp
node['exabgp']['config_path'] Location of the ExaBGP configuration file, only set when a resource with instance set to false is configured /etc/exabgp/exabgp.conf
node['exabgp']['source_url'] URL to the git repository for source installtions https://github.com/Exa-Networks/exabgp.git
node['exabgp']['source_version'] git ref of the version to install master

Recipes

  • exabgp::default - Intentionally left blank, see resource usage below

Resources

exabgp

The exabgp resource installs and configures ExaBGP. It does not create
an ExaBGP service. You will need to handle this separately via your service
resource of choice. If you want an example of such a service setup, look at
the test/cookbooks folder for some example recipes.

Actions

  • :install – Install and configure ExaBGP. (default)

Parameters

  • instance – Name of the ExaBGP installation. If different than the name parameter of the resource. If it is set to false, it will not use the name parameter when naming the instance. This is for backward compatibility with the older version of this cookbook where you may be running an install from /etc/exabgp.
  • package_version – Which version of the python package to install, defaults to the node['exabgp']['package_version'] attribute.
  • cookbook – Which cookbook to look for the exabgp.conf.erb template
  • variables – Pass template variables in much like a template resource
  • install_type – Supports three type :package (distribution package), :pip (python package) and :source installations. Defaults to :package . If you'd like to support more installation options, send in a pull request. :heart:

Examples

# Installs into /etc/exabgp-anycast
exabgp 'anycast'

# Backward compatible with the previous exabgp cookbook
# Installs to /etc/exabgp
exabgp 'anycast' do
  instance false
end

# Use your own template from templates/default/exabgp.conf.erb
exabgp 'anycast' do
  cookbook 'mycorp-exabgp'
end

# Setup a service
service 'exabgp'

License and Authors

Copyright:: 2013-2018 DNSimple Corp.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

主要指标

概览
名称与所有者criteo-cookbooks/chef-exabgp
主编程语言Ruby
编程语言Ruby (语言数: 3)
平台
许可证Apache License 2.0
所有者活动
创建于2012-11-12 22:05:05
推送于2018-09-12 16:52:28
最后一次提交2018-09-12 09:52:14
发布数17
最新版本名称v3.2.3 (发布于 2018-09-12 09:52:24)
第一版名称0.9.0 (发布于 )
用户参与
星数11
关注者数12
派生数9
提交数172
已启用问题?
问题数8
打开的问题数4
拉请求数14
打开的拉请求数0
关闭的拉请求数3
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?