Commit b1d14d4e authored by spiderman's avatar spiderman Committed by spiderman

intermediate commit which re-introduces provision_dns into the 0.2 stream of development

parent 0a827286
<?php
// $Id$
/**
* @file
* Provision hooks for the delete command
**/
/**
* Implementation of hook_provision_delete()
*
* delete the RR for this site at least, but possibly also the zone itself?
* need to lookup the zid for the base zone of this site, and then call provision_dns_rr with the zid and site 'name'
* (ie: pull off the tld and second-level domain for the 'base' zone, and treat the rest as the 'name')
*/
function provision_dns_provision_delete(&$data, $url = NULL) {
if ($url) {
# provision_dns_delete($url);
}
}
<?php
// $Id$
/**
* @file
* Provision hooks for the install command
**/
/**
* Implementation of hook_provision_pre_install
**/
function provision_dns_provision_pre_install(&$data, $url = NULL) {
# data should now contain zone info directly, rather than having to pull them from
if ($url) {
# $url_parts = _provision_dns_split_url($url);
# if (!isset($url_parts['zone'])) {
provision_set_error(PROVISION_FRAMEWORK_ERROR);
return;
# }
# the zone object should be passed in..
# $zone = provision_dns_create_zone($url_parts['zone'], $data); # initialize zone for this domain (if it doesn't exist)
# provision_dns_create_record($url_parts['host'], $zone, $data); # creates the RR for the (sub)domain
# provision_dns_commit($data['dns_id']); # makes the changes live (ie: restart bind)
}
}
/**
* Implementation of hook_provision_pre_install_rollback
**/
function provision_dns_provision_pre_install_rollback(&$data, $url = NULL) {
if ($url) {
# provision_dns_delete($url);
}
}
/**
* Implementation of hook_provision_post_install
**/
function provision_dns_provision_post_install(&$data, $url = NULL) {
# commit and restart bind
}
This diff is collapsed.
This diff is collapsed.
name = Provision: DNS
description = Provides provisioning requirements for DNS servers
package = Provision
dependencies[] = provision
core = 6.x
<?php
// $Id$
/**
* @file
* Provision hooks for the restore command
**/
/**
* Implementation of hook_provision_pre_restore
* This is a duplicate of the _pre_install hook
**/
function provision_dns_provision_pre_restore(&$data, $url = NULL) {
# re-install the zonefiles and/or resource records for the site?
# _provision_dns_provision_pre_restore($url, $data);
}
/**
* Implementation of hook_provision_pre_restore_rollback
* This duplicates the _pre_install_rollback hook
**/
function provision_dns_provision_pre_restore_rollback(&$data, $url = NULL) {
# remove them again?
if ($url) {
# _provision_dns_delete($url);
}
}
function provision_dns_provision_post_restore(&$data, $url = NULL) {
# restart bind?
}
function provision_dns_provision_post_restore_rollback(&$data, $url = NULL) {
# restart bind
}
<?php
// $Id$
/**
* @file
* Provision hooks for the verify command
**/
/**
* Implementation of hook_provision_verify
*
* Can't be rolled back.
*/
function provision_dns_provision_verify(&$data, $url = NULL) {
if (!$url) {
// we are verifying a platform
# Where does this constant come from now?
# _provision_create_dir(PROVISION_NAMED_PATH, t('Provision DNS configuration'), 0755);
# The above perms should really be 750, but that means the aegir user must be in the 'bind' group, so this will work:
# provision_path("chgrp", PROVISION_NAMED_PATH, 'bind',
# t('Changed group ownership of '.PROVISION_NAMED_PATH.' to @confirm'),
# t('Could not change group ownership of '.PROVISION_NAMED_PATH.' to @confirm'));
} else {
provision_log("notice", "Hit provision_dns_provision_verify hook: $url");
# $url_parts = _provision_dns_split_url($url);
if (!isset($url_parts['zone'])) {
provision_set_error(PROVISION_FRAMEWORK_ERROR);
return;
}
# $zone = provision_dns_create_zone($url_parts['zone'], $data); # initializes the zone for the domain (if it doesn't exist)
# provision_dns_create_record($url_parts['host'], $zone, $data); # creates the RR for the (sub)domain
# provision_dns_commit($data['dns_id']); # makes the changes live (ie: restart bind)
}
}
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