feat: OKD bootstrap automation pretty much complete with a few prompt for manual steps
Some checks failed
Run Check Script / check (pull_request) Failing after 1m12s
Some checks failed
Run Check Script / check (pull_request) Failing after 1m12s
This commit is contained in:
@@ -4,7 +4,7 @@ use crate::{
|
||||
config::{SshConfigManager, SshCredentials, SshOPNSenseShell},
|
||||
error::Error,
|
||||
modules::{
|
||||
caddy::CaddyConfig, dhcp_legacy::DhcpConfigLegacyISC, dns::DnsConfig,
|
||||
caddy::CaddyConfig, dhcp_legacy::DhcpConfigLegacyISC, dns::UnboundDnsConfig,
|
||||
dnsmasq::DhcpConfigDnsMasq, load_balancer::LoadBalancerConfig, tftp::TftpConfig,
|
||||
},
|
||||
};
|
||||
@@ -51,8 +51,8 @@ impl Config {
|
||||
DhcpConfigDnsMasq::new(&mut self.opnsense, self.shell.clone())
|
||||
}
|
||||
|
||||
pub fn dns(&mut self) -> DnsConfig<'_> {
|
||||
DnsConfig::new(&mut self.opnsense)
|
||||
pub fn dns(&mut self) -> DhcpConfigDnsMasq<'_> {
|
||||
DhcpConfigDnsMasq::new(&mut self.opnsense, self.shell.clone())
|
||||
}
|
||||
|
||||
pub fn tftp(&mut self) -> TftpConfig<'_> {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use opnsense_config_xml::{Host, OPNsense};
|
||||
|
||||
pub struct DnsConfig<'a> {
|
||||
pub struct UnboundDnsConfig<'a> {
|
||||
opnsense: &'a mut OPNsense,
|
||||
}
|
||||
|
||||
impl<'a> DnsConfig<'a> {
|
||||
impl<'a> UnboundDnsConfig<'a> {
|
||||
pub fn new(opnsense: &'a mut OPNsense) -> Self {
|
||||
Self { opnsense }
|
||||
}
|
||||
|
||||
@@ -144,14 +144,16 @@ impl<'a> DhcpConfigDnsMasq<'a> {
|
||||
let host_to_modify_ip = host_to_modify.ip.content_string();
|
||||
if host_to_modify_ip != ip_str {
|
||||
warn!(
|
||||
"Hostname '{}' already exists with a different IP ({}). Appending MAC {}.",
|
||||
"Hostname '{}' already exists with a different IP ({}). Setting new IP {ip_str}. Appending MAC {}.",
|
||||
hostname, host_to_modify_ip, mac
|
||||
);
|
||||
host_to_modify.ip.content = Some(ip_str);
|
||||
} else if host_to_modify.host != hostname {
|
||||
warn!(
|
||||
"IP {} already exists with a different hostname ('{}'). Appending MAC {}.",
|
||||
"IP {} already exists with a different hostname ('{}'). Setting hostname to {hostname}. Appending MAC {}.",
|
||||
ipaddr, host_to_modify.host, mac
|
||||
);
|
||||
host_to_modify.host = hostname.to_string();
|
||||
}
|
||||
|
||||
if !host_to_modify
|
||||
|
||||
Reference in New Issue
Block a user