|
@@ -46,6 +46,7 @@ class BaseKea implements KeaConfigInterface
|
|
|
'Dhcp4' => [
|
|
|
'control-socket' => $this->controlSocketConfig(),
|
|
|
'lease-database' =>$this->leaseDatabaseConfig(),
|
|
|
+ 'hosts-database' =>$this->leaseDatabaseConfig(),
|
|
|
'subnet4' => $this->subnet4,
|
|
|
'hooks-libraries' => $this->hooks_libraries,
|
|
|
'interfaces-config' => $this->getInterfacesConfig(),
|
|
@@ -180,13 +181,24 @@ class BaseKea implements KeaConfigInterface
|
|
|
/**
|
|
|
* @return array
|
|
|
*/
|
|
|
- private function leaseDatabaseConfig()
|
|
|
+ private function leaseDatabaseConfig($type = 'mysql')
|
|
|
{
|
|
|
- /* "lease-database": {"lfc-interval": 3600,"type": "memfile"} */
|
|
|
- return array(
|
|
|
- 'lfc-interval' => 3600,
|
|
|
- 'type' => 'memfile'
|
|
|
- );
|
|
|
+ if ($type == 'mysql') {
|
|
|
+ $config = array(
|
|
|
+ "host": "mysql",
|
|
|
+ "name": "kea",
|
|
|
+ "user": "root",
|
|
|
+ "password": getenv('MYSQL_ROOT_PASSWORD'),
|
|
|
+ "type": "mysql",
|
|
|
+ );
|
|
|
+ } elseif ($type == 'memfile') {
|
|
|
+ $config = array(
|
|
|
+ 'lfc-interval' => 3600,
|
|
|
+ 'type' => 'memfile'
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
+ return $config;
|
|
|
}
|
|
|
|
|
|
/**
|