SmartProxyDhcpKea

This Foreman smart proxy plugin allow to interface with Kea DHCP provider. Postgres and Mysql database are supported, anyway Mysql has not been tested yet.

Installation

Smart proxy plugin are ruby gems. They can be easly instaled with gem.

Prerequisites

The smart proxy need to interact both with postgresql and mysql. To do that it uses mysql2 and pg gems, which are automatically installed, but some dependencies are needed. So if gem installation goes wrong, try to install them with yum:

yum install ruby-devel
yum install potgresql-devel
yum install mysql-devel

Manual installation

It's possible to install manually this smart proxy plugin using gem

gem install 'smart_proxy_dhcp_kea'

The gem with all its dependencies will be installed. Next you need to specify the gem into the ~foreman-proxy/bundler.d/Gemfile.local.rb file. Create the file if it doesn't exist.

echo "gem 'smat_proxy_dhcp_kea'" > /usr/share/foreman-proxy/bundler.d/Gemfile.local.rb

Next restart the foreman-proxy service and refresh features form the control panel.

systemctl restart foreman-proxy  

The DHCP feature should be now active.

Configuration

To enable this DHCP provider, edit /etc/foreman-proxy/settings.d/dhcp.yml and set:

:use_provider: dhcp_kea

Then you need to create /etc/foreman-proxy/settings.d/dhcp_kea.yml file and specify the following parameters.

:db: [postgres, mysql]
:dbname: [database_name]
:username: [username]
:password: [password]
:host: [host_address]
:port: [db_port]

This smart proxy support both postgres and mysql database for kea. You need to specify in the configuration file which one are you going to use. Mysql is the default databse. Also, if postgres is choosen, a table called subnets, in which subnets are stored into keasubnets database is required. The subnet schema is indeed present by default in MySQL database.

Contributing

Pierfrancesco Cifra