Compare commits
3 Commits
feat/broca
...
fix/opnsen
| Author | SHA1 | Date | |
|---|---|---|---|
| 43a17811cc | |||
| 29c82db70d | |||
| 83c1cc82b6 |
@@ -135,8 +135,6 @@ impl OpenShiftNmStateNetworkManager {
|
|||||||
description: Some(format!("Member of bond {bond_name}")),
|
description: Some(format!("Member of bond {bond_name}")),
|
||||||
r#type: nmstate::InterfaceType::Ethernet,
|
r#type: nmstate::InterfaceType::Ethernet,
|
||||||
state: "up".to_string(),
|
state: "up".to_string(),
|
||||||
mtu: Some(switch_port.interface.mtu),
|
|
||||||
mac_address: Some(switch_port.interface.mac_address.to_string()),
|
|
||||||
ipv4: Some(nmstate::IpStackSpec {
|
ipv4: Some(nmstate::IpStackSpec {
|
||||||
enabled: Some(false),
|
enabled: Some(false),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -162,7 +160,7 @@ impl OpenShiftNmStateNetworkManager {
|
|||||||
|
|
||||||
interfaces.push(nmstate::Interface {
|
interfaces.push(nmstate::Interface {
|
||||||
name: bond_name.to_string(),
|
name: bond_name.to_string(),
|
||||||
description: Some(format!("Network bond for host {host}")),
|
description: Some(format!("HARMONY - Network bond for host {host}")),
|
||||||
r#type: nmstate::InterfaceType::Bond,
|
r#type: nmstate::InterfaceType::Bond,
|
||||||
state: "up".to_string(),
|
state: "up".to_string(),
|
||||||
copy_mac_from,
|
copy_mac_from,
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ pub struct EthernetSpec {
|
|||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
pub struct BondSpec {
|
pub struct BondSpec {
|
||||||
pub mode: String,
|
pub mode: String,
|
||||||
|
#[serde(alias = "port")]
|
||||||
pub ports: Vec<String>,
|
pub ports: Vec<String>,
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub options: Option<BTreeMap<String, Value>>,
|
pub options: Option<BTreeMap<String, Value>>,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, Ord)]
|
#[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, Ord)]
|
||||||
pub struct MacAddress(pub [u8; 6]);
|
pub struct MacAddress(pub [u8; 6]);
|
||||||
|
|
||||||
impl MacAddress {
|
impl MacAddress {
|
||||||
@@ -19,6 +19,14 @@ impl From<&MacAddress> for String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for MacAddress {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
f.debug_tuple("MacAddress")
|
||||||
|
.field(&String::from(self))
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl std::fmt::Display for MacAddress {
|
impl std::fmt::Display for MacAddress {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.write_str(&String::from(self))
|
f.write_str(&String::from(self))
|
||||||
|
|||||||
@@ -106,11 +106,37 @@ pub struct HAProxy {
|
|||||||
pub groups: MaybeString,
|
pub groups: MaybeString,
|
||||||
pub users: MaybeString,
|
pub users: MaybeString,
|
||||||
pub cpus: MaybeString,
|
pub cpus: MaybeString,
|
||||||
pub resolvers: MaybeString,
|
pub resolvers: HAProxyResolvers,
|
||||||
pub mailers: MaybeString,
|
pub mailers: MaybeString,
|
||||||
pub maintenance: Maintenance,
|
pub maintenance: Maintenance,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||||
|
pub struct HAProxyResolvers {
|
||||||
|
#[yaserde(rename = "resolver")]
|
||||||
|
pub resolver: Resolver,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||||
|
pub struct Resolver {
|
||||||
|
pub id: String,
|
||||||
|
pub enabled: i32,
|
||||||
|
pub name: String,
|
||||||
|
pub description: MaybeString,
|
||||||
|
pub nameservers: String,
|
||||||
|
pub parse_resolv_conf: String,
|
||||||
|
pub resolve_retries: i32,
|
||||||
|
pub timeout_resolve: String,
|
||||||
|
pub timeout_retry: String,
|
||||||
|
pub accepted_payload_size: MaybeString,
|
||||||
|
pub hold_valid: MaybeString,
|
||||||
|
pub hold_obsolete: MaybeString,
|
||||||
|
pub hold_refused: MaybeString,
|
||||||
|
pub hold_nx: MaybeString,
|
||||||
|
pub hold_timeout: MaybeString,
|
||||||
|
pub hold_other: MaybeString,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
#[derive(Default, PartialEq, Debug, YaSerialize, YaDeserialize)]
|
||||||
pub struct Maintenance {
|
pub struct Maintenance {
|
||||||
#[yaserde(rename = "cronjobs")]
|
#[yaserde(rename = "cronjobs")]
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ pub struct System {
|
|||||||
pub maximumfrags: Option<MaybeString>,
|
pub maximumfrags: Option<MaybeString>,
|
||||||
pub aliasesresolveinterval: Option<MaybeString>,
|
pub aliasesresolveinterval: Option<MaybeString>,
|
||||||
pub maximumtableentries: Option<MaybeString>,
|
pub maximumtableentries: Option<MaybeString>,
|
||||||
pub language: String,
|
pub language: Option<String>,
|
||||||
pub dnsserver: Option<MaybeString>,
|
pub dnsserver: Option<MaybeString>,
|
||||||
pub dns1gw: Option<String>,
|
pub dns1gw: Option<String>,
|
||||||
pub dns2gw: Option<String>,
|
pub dns2gw: Option<String>,
|
||||||
@@ -1291,6 +1291,7 @@ pub struct WireguardServerItem {
|
|||||||
pub gateway: MaybeString,
|
pub gateway: MaybeString,
|
||||||
pub carp_depend_on: MaybeString,
|
pub carp_depend_on: MaybeString,
|
||||||
pub peers: String,
|
pub peers: String,
|
||||||
|
pub debug: MaybeString,
|
||||||
pub endpoint: MaybeString,
|
pub endpoint: MaybeString,
|
||||||
pub peer_dns: MaybeString,
|
pub peer_dns: MaybeString,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user