Event Hooks for DNS Cluster Servers
As a developer/system administrator for a web-hosting provider, I would like a feature improvement of:
Standardized Hook - Hookable Event 's being triggered for when a DNS Cluster Server is either added, removed or modified.
I hope for something like:
category: Whostmgr
event: Cluster::add_server
- pre stage:
- - cluster_type
- - cluster_user
- - role
- post stage:
- - cluster_type
- - cluster_user
- - server_name (aka cluster member/config file)
- - role
event: Cluster::modify_server
- pre stage:
- - cluster_type
- - cur_server_name (aka cluster member/config file)
- - cur_role
- - cluster_user
- post stage:
- - cluster_type
- - cur_server_name (aka cluster member/config file)
- - new_server_name (aka cluster member/config file)
- - cur_role
- - new_role
- - cluster_user
event: Cluster::remove_server
- pre stage:
- - cluster_type
- - server_name (aka cluster member/config file)
- - sync_setting
- - cluster_user
- post stage:
- - cluster_type
- - del_server_name (aka cluster member/config file)
- - del_sync_setting (as it was before removal)
- - cluster_user
It would be an additional bonus if there were also events for the DNS Clustering being enabled and disabled:
event: Cluster::enabled
event: Cluster::disabled
(no return/event data)
and also one if a cluster module is automatically disabled for reasons:
event: Cluster::suspend_server
- pre/post stage:
- - cluster_type
- - server_name (aka cluster member/config file)
- - sync_setting (as it was before suspension: change to "cur_sync_setting" for post)
- - cluster_user
event: Cluster::unsuspend_server
- pre/post stage:
- - cluster_type
- - server_name (aka cluster member/config file)
- - new_sync_setting
- - cluster_user
So that this will allow DNS Cluster developers to hook into things like the removal of cluster servers related to their module so they can do things like remove additional configuration files or revoke unused trust of cluster servers (see a 2 year old feature request)
Notes:
It looks like adding new hookable event s to:
- /usr/local/cpanel/whostmgr/docroot/cgi/activate_remote_nameservers.cgi before the $namespace->setup line will handle the add_server and modify_server pre events and before the render_return_to_cluster_status line for the post events.
- /usr/local/cpanel/whostmgr/docroot/cgi/changeclusterdns.cgi either side of the Cpanel::DNSLib::PeerConfig::change_dns_role to handle the modify_server pre and post events in the case of just the role being changed.
- /usr/local/cpanel/whostmgr/docroot/cgi/remclusterserver.cgi either side of the unlink statement to handle the remove_server pre and post events <- This would address my major "issue"
- /usr/local/cpanel/whostmgr/docroot/cgi/adjustclusterdns.cgi if ($cluster) ... statement to handle the enabled/disabled events
- /usr/local/cpanel/whostmgr/docroot/cgi/enableclusterserver.cgi for the unsuspend_server event
- I can't see where the /var/cpanel/clusterqueue/status/' . $server . '-down' file is written for the suspend_server event
Replies have been locked on this page!