Compare commits

..

No commits in common. "7ee71ee5ecc0f98edee926b7dfbcc9dfe8c33b58" and "653b66b04213c3d104adb14364650f049b7913b5" have entirely different histories.

2 changed files with 8 additions and 8 deletions

View file

@ -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.");
} }

View file

@ -10,7 +10,7 @@ var ipAddress = inputProperties.addresses[0];
var created = false; var created = false;
if (staticDns == "true" && dnsHost.supportedDomains.indexOf(dnsDomain) >= 0) { if (staticDns == "true" && dnsHost.supportedDomains.indexOf(dnsDomain) >= 0) {
System.log("Attempting to create DNS record for " + hostname + "." + ipAddress + "..."); System.log("Attempting to create DNS record for " + hostname + "." + ipAddress + "...");
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 (dnsServer in dnsHost.dnsServers) { for each (dnsServer in dnsHost.dnsServers) {
@ -31,4 +31,4 @@ if (staticDns == "true" && dnsHost.supportedDomains.indexOf(dnsDomain) >= 0) {
} }
} else { } else {
System.log("Not trying to do DNS."); System.log("Not trying to do DNS.");
} }