mirror of
https://github.com/jbowdre/vRealize.git
synced 2024-12-04 05:52:18 +00:00
Update 01_delete_dns_record.js
This commit is contained in:
parent
653b66b042
commit
81162ccb49
1 changed files with 6 additions and 6 deletions
|
@ -6,12 +6,12 @@
|
||||||
var hostname = inputProperties.resourceNames[0];
|
var hostname = inputProperties.resourceNames[0];
|
||||||
var dnsDomain = inputProperties.customProperties.domain;
|
var dnsDomain = inputProperties.customProperties.domain;
|
||||||
var deleted = false;
|
var deleted = false;
|
||||||
if (dnsHost_supportedDomains.indexOf(dnsDomain) >= 0) {
|
if (dnsHost.supportedDomains.indexOf(dnsDomain) >= 0) {
|
||||||
System.log("Attempting to remove DNS record for " + hostname + "...");
|
System.log("Attempting to remove DNS record for " + hostname + "...");
|
||||||
var sshSession = new SSHSession(dnsHost_sshHost, dnsHost_sshUser);
|
var sshSession = new SSHSession(dnsHost.sshHost, dnsHost.sshUser);
|
||||||
System.debug("Connecting to " + dnsHost_sshHost + "...");
|
System.debug("Connecting to " + dnsHost.sshHost + "...");
|
||||||
sshSession.connectWithPassword(dnsHost_sshPass);
|
sshSession.connectWithPassword(dnsHost.sshPass);
|
||||||
for each (var dnsServer in dnsHost_dnsServers) {
|
for each (var dnsServer in dnsHost.dnsServers) {
|
||||||
if (deleted == false) {
|
if (deleted == false) {
|
||||||
System.debug("Using DNS Server " + dnsServer + "...");
|
System.debug("Using DNS Server " + dnsServer + "...");
|
||||||
var sshCommand = 'Remove-DnsServerResourceRecord -ComputerName ' + dnsServer + ' -Name ' + hostname + ' -ZoneName ' + dnsDomain + ' -RRType A -Force';
|
var sshCommand = 'Remove-DnsServerResourceRecord -ComputerName ' + dnsServer + ' -Name ' + hostname + ' -ZoneName ' + dnsDomain + ' -RRType A -Force';
|
||||||
|
@ -29,4 +29,4 @@ if (dnsHost_supportedDomains.indexOf(dnsDomain) >= 0) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.log("No need to remove DNS records.");
|
System.log("No need to remove DNS records.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue