pub struct Environment {Show 16 fields
pub name: String,
pub target: Target,
pub instance: Option<u8>,
pub networks: IndexMap<String, NetworkPlan>,
pub outside: IndexMap<String, OutsideNetwork>,
pub router: Option<IndexMap<String, Ipv4Addr>>,
pub router6: IndexMap<String, Ipv6Addr>,
pub machines: IndexMap<String, MachinePlan>,
pub start_order: Vec<String>,
pub checks: Vec<Resolved>,
pub controller: Option<Controller>,
pub constraints: Option<Constraints>,
pub requirements: Vec<Requirement>,
pub images: Images,
pub inventory_groups: IndexMap<String, Vec<String>>,
pub private_dns: Option<PrivateDns>,
/* private fields */
}Expand description
One environment, planned for one target.
Fields§
§name: StringThe environment’s name (Compose project, resource prefix).
target: TargetThe target it is planned for.
instance: Option<u8>The instance number, when several copies of the environment run side by side.
networks: IndexMap<String, NetworkPlan>Its networks, in spec order.
outside: IndexMap<String, OutsideNetwork>The networks outside the environment (external, bridged), in spec order: never in
Environment::networks nor in the spec the backends read.
router: Option<IndexMap<String, Ipv4Addr>>Isoloom’s router, when reach rules need one: its address on each network it routes.
router6: IndexMap<String, Ipv6Addr>The router’s IPv6 address on each IPv6 network it routes (empty without a router).
machines: IndexMap<String, MachinePlan>Its machines, in spec order.
start_order: Vec<String>Machine names, each after the machines it waits for.
checks: Vec<Resolved>The checks, resolved to positions and probes.
controller: Option<Controller>The controller VM running playbooks, when the environment needs one.
constraints: Option<Constraints>The spec’s constraints (proxy, mirrors, registries, NTP), when it has any.
requirements: Vec<Requirement>What the environment asks of the backend rendering it.
images: ImagesThe image references to pull, through the registry mirrors.
inventory_groups: IndexMap<String, Vec<String>>The Ansible inventory groups and their members (see ansible::groups).
private_dns: Option<PrivateDns>The private DNS zone, when dns.private is on: its domain and records.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn build(spec: &Spec, target: Target, instance: Option<u8>) -> Environment
pub fn build(spec: &Spec, target: Target, instance: Option<u8>) -> Environment
Plans a validated spec for target (instance: the copy it is, when several run).
Sourcepub fn spec(&self) -> &Spec
pub fn spec(&self) -> &Spec
The spec as laid out for the target, for what the plan doesn’t model yet.
Sourcepub fn address_for(&self, from: &str, to: &str) -> Ipv4Addr
pub fn address_for(&self, from: &str, to: &str) -> Ipv4Addr
The address from reaches to at: on a network they share, else to’s first.
Sourcepub fn probe_address(&self, name: &str, network: &str) -> String
pub fn probe_address(&self, name: &str, network: &str) -> String
Where a probe reaches machine name on network: its IPv4 address, or on an IPv6-only
network its IPv6 one. Its name, which the target’s DNS resolves, when it has no address
there: on an IPv6-only network that leaves addresses to the target (or a machine or a
network the plan doesn’t hold, which no check of the plan names).