Commit ba6581ff authored by anarcat's avatar anarcat Committed by anarcat

make slave reload work

parent 04a5f9a8
......@@ -5,7 +5,8 @@ mixes todos, test procedures and install procedures.
Master server configuration
===========================
First, install bind, allow aegir to sudo rndc reload.
First, install bind, allow aegir to sudo rndc reload. Make sure the bind user
can read hostmaster files (adduser bind hostmaster).
Then add the DNS service in the frontend. This should trigger a server
verification and configure the DNS service in the backend. Creating a site
......@@ -62,12 +63,8 @@ Caveats
engines more difficult and would require writing parsers for all
engines.
Bugs
====
1. bind is not restarted on slaves
Todo
====
1. the association between slaves and master doesn't exist in the frontend yet
2. NS records are not managed properly (they should be deduced from master/slave relationships)
......@@ -26,7 +26,8 @@ class provisionService_dns_bind extends provisionService_dns {
}
function parse_configs() {
$this->restart();
$status = $this->restart();
return $status && parent::parse_configs();
}
}
......
......@@ -58,7 +58,8 @@ function drush_dns_provision_zone($action, $zone, $name = null, $type = null, $d
$status = drush_set_error('DRUSH_WRONG_ARGUMENT', dt("wrong argument provided to provision-zone"));
break;
}
$status = $status && d()->service('dns')->commit($zone);
// XXX: we shouldn't reload zones unless we have actually done changes, but return values of the above functions are always FALSE
d()->service('dns')->parse_configs();
return $status;
}
......@@ -104,7 +105,7 @@ class provisionService_dns extends provisionService {
function parse_configs() {
return null;
return $this->_each_server("parse_configs");
}
function init_server() {
......@@ -271,24 +272,32 @@ class provisionService_dns extends provisionService {
}
drush_log(dt("creating zone %zone", array("%zone" => $zone)));
$this->config('zone', $zone)->write();
$status = $this->config('zone', $zone)->write();
if ($status) {
drush_log(dt("recording zone in server configuration"));
$this->config('server')->record_set($zone, $zone)->write();
$status = $this->config('server')->record_set($zone, $zone)->write();
}
if ($status) {
drush_log(dt("creating zone configuration on slaves"));
$this->_each_server("create_zone", array($this->context->ip_addresses, $zone));
$status = $this->_each_server("create_zone", array($this->context->ip_addresses, $zone));
}
return $status;
}
/**
* This completely drops a zone, without any checks.
*/
function delete_zone($zone) {
$this->config('zone', $zone)->unlink();
$this->config('server')->record_del($zone, $zone)->write();
$status = $this->config('zone', $zone)->unlink();
$status = $status && $this->config('server')->record_del($zone, $zone)->write();
if ($status) {
drush_log(dt("deleting zone configuration from slaves"));
$this->_each_server("delete_zone", $zone);
$status = $this->_each_server("delete_zone", $zone);
}
return $status;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment