summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Beaupré2011-03-11 21:46:37 (GMT)
committerAntoine Beaupré2011-03-11 21:46:37 (GMT)
commit78fb426d7af88bc9c3c3acfb5e1f6382de36fc93 (patch)
tree21fa437a48afca83d7e7d308a098d215d15ee21d
parentb036b9514e86630a6fd06377903d6a25cbe06855 (diff)
parent5e8329b3c73e37b4c1c598a2c252716262afdc18 (diff)
Merge branch 'master' into 6.x-1.x
-rw-r--r--dns/dns.drush.inc18
1 files changed, 16 insertions, 2 deletions
diff --git a/dns/dns.drush.inc b/dns/dns.drush.inc
index 6b60034..b396ac4 100644
--- a/dns/dns.drush.inc
+++ b/dns/dns.drush.inc
@@ -322,6 +322,7 @@ class provisionService_dns extends provisionService {
$host = $this->context->uri;
$zone = $this->context->dns_zone;
$sub = $this->context->dns_zone_subdomain;
+ $aliases = $this->context->aliases;
}
else {
return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create");
@@ -340,6 +341,12 @@ class provisionService_dns extends provisionService {
}
$this->config('zone', $zone)->record_set($sub, array('A' => $ips));
+ foreach ($aliases as $alias) {
+ if ($this->guess_zone($alias) == $zone) {
+ $this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'),
+ array('CNAME' => array($zone . '.')));
+ }
+ }
$this->create_zone($zone);
$this->create_config('host');
@@ -363,14 +370,21 @@ class provisionService_dns extends provisionService {
$host = $this->context->uri;
$zone = $this->context->dns_zone;
$sub = $this->context->dns_zone_subdomain;
+ $aliases = $this->context->aliases;
}
else {
return drush_set_error('DRUSH_DNS_NO_ZONE', "Could not determine the zone to create");
}
// remove the records from the zone store
- $this->config('zone', $zone)->
- record_set($sub, array('A' => null))->write();
+ $this->config('zone', $zone)->record_set($sub, array('A' => NULL));
+ foreach ($aliases as $alias) {
+ if ($this->guess_zone($alias) == $zone) {
+ $this->config('zone', $zone)->record_set($this->guess_zone($alias, 'subdomain'),
+ array('CNAME' => NULL));
+ }
+ }
+ $this->config('zone', $zone)->write();
}
}