Skip to content

Commit

Permalink
Merge branch 'master' of github.com:erlarese/afterburn
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Larese committed Aug 5, 2020
2 parents cf2b1ce + d12ab26 commit 272df43
Show file tree
Hide file tree
Showing 19 changed files with 982 additions and 230 deletions.
62 changes: 45 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exclude = ["/.cci.jenkinsfile", "/.github", "/.gitignore", "/.travis.yml"]
authors = [ "Stephen Demos <stephen.demos@coreos.com>",
"Luca Bruno <lucab@debian.org>" ]
description = "A simple cloud provider agent"
version = "4.4.2-alpha.0"
version = "4.4.3-alpha.0"

[package.metadata.release]
sign-commit = true
Expand All @@ -31,11 +31,11 @@ cfg-if = "^0.1"
clap = "^2.33"
error-chain = { version = "^0.12", default-features = false }
hostname = "^0.3"
ipnetwork = "^0.16"
ipnetwork = "^0.17"
libsystemd = "^0.2.1"
maplit = "^1.0"
mime = "^0.3"
nix = "^0.17"
nix = "^0.18"
openssh-keys = "^0.4"
openssl = "^0.10"
pnet_base = "^0.26"
Expand All @@ -62,4 +62,4 @@ features = ["max_level_trace", "release_max_level_info"]
cl-legacy = ["update-ssh-keys"]

[dev-dependencies]
mockito = "^0.26"
mockito = "^0.27"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ The following platforms are supported, with a different set of features availabl
- SSH Keys
* ibmcloud-classic
- Attributes
* openstack
- Attributes
- SSH Keys
* openstack-metadata
- Attributes
- SSH Keys
Expand All @@ -64,3 +67,6 @@ The following platforms are supported, with a different set of features availabl
- SSH Keys
* vmware
- Custom network command-line arguments
* vultr
- Attributes
- SSH Keys
9 changes: 9 additions & 0 deletions docs/usage/attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ Cloud providers with supported metadata endpoints and their respective attribute
* ibmcloud-classic
- AFTERBURN_IBMCLOUD_CLASSIC_INSTANCE_ID
- AFTERBURN_IBMCLOUD_CLASSIC_LOCAL_HOSTNAME
* openstack
- AFTERBURN_OPENSTACK_HOSTNAME
- AFTERBURN_OPENSTACK_IPV4_LOCAL
- AFTERBURN_OPENSTACK_IPV4_PUBLIC
- AFTERBURN_OPENSTACK_INSTANCE_ID
- AFTERBURN_OPENSTACK_INSTANCE_TYPE
* openstack-metadata
- AFTERBURN_OPENSTACK_HOSTNAME
- AFTERBURN_OPENSTACK_IPV4_LOCAL
Expand All @@ -89,6 +95,9 @@ Cloud providers with supported metadata endpoints and their respective attribute
- AFTERBURN_PACKET_IPV4_PRIVATE_GATEWAY_0
- AFTERBURN_PACKET_IPV6_PUBLIC_0
- AFTERBURN_PACKET_IPV6_PUBLIC_GATEWAY_0
- AFTERBURN_VULTR_HOSTNAME
- AFTERBURN_VULTR_INSTANCE_ID
- AFTERBURN_VULTR_REGION_CODE

Additionally, some attribute names are reserved for custom metadata providers.
These can be safely used by external providers on platforms not supported by Afterburn:
Expand Down
6 changes: 6 additions & 0 deletions docs/usage/legacy-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ On legacy `coreos-metadata` versions, the supported cloud providers and their re
- Attributes
- COREOS_VAGRANT_VIRTUALBOX_PRIVATE_IPV4
- COREOS_VAGRANT_VIRTUALBOX_HOSTNAME
- vultr
- SSH Keys
- Attributes
- COREOS_VULTR_HOSTNAME
- COREOS_VULTR_INSTANCE_ID
- COREOS_VULTR_REGION_CODE

Additionally, some attribute names are reserved for usage by [custom metadata providers][custom-metadata].
These can be safely used by external providers on a platform not supported by Afterburn:
Expand Down
1 change: 1 addition & 0 deletions dracut/30afterburn/afterburn-hostname.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Description=Afterburn Hostname
ConditionKernelCommandLine=|ignition.platform.id=azure
ConditionKernelCommandLine=|ignition.platform.id=digitalocean
ConditionKernelCommandLine=|ignition.platform.id=exoscale
ConditionKernelCommandLine=|ignition.platform.id=vultr

# We order this service after sysroot has been mounted
# but before ignition-files stage has run, so ignition can
Expand Down
8 changes: 6 additions & 2 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ use crate::providers::exoscale::ExoscaleProvider;
use crate::providers::gcp::GcpProvider;
use crate::providers::ibmcloud::IBMGen2Provider;
use crate::providers::ibmcloud_classic::IBMClassicProvider;
use crate::providers::openstack::network::OpenstackProvider;
use crate::providers::openstack;
use crate::providers::openstack::network::OpenstackProviderNetwork;
use crate::providers::packet::PacketProvider;
#[cfg(feature = "cl-legacy")]
use crate::providers::vagrant_virtualbox::VagrantVirtualboxProvider;
use crate::providers::vmware::VmwareProvider;
use crate::providers::vultr::VultrProvider;

macro_rules! box_result {
($exp:expr) => {
Expand Down Expand Up @@ -61,11 +63,13 @@ pub fn fetch_metadata(provider: &str) -> errors::Result<Box<dyn providers::Metad
"ibmcloud" => box_result!(IBMGen2Provider::try_new()?),
// IBM Cloud - Classic infrastructure.
"ibmcloud-classic" => box_result!(IBMClassicProvider::try_new()?),
"openstack-metadata" => box_result!(OpenstackProvider::try_new()?),
"openstack" => openstack::try_config_drive_else_network(),
"openstack-metadata" => box_result!(OpenstackProviderNetwork::try_new()?),
"packet" => box_result!(PacketProvider::try_new()?),
#[cfg(feature = "cl-legacy")]
"vagrant-virtualbox" => box_result!(VagrantVirtualboxProvider::new()),
"vmware" => box_result!(VmwareProvider::try_new()?),
"vultr" => box_result!(VultrProvider::try_new()?),
_ => Err(errors::ErrorKind::UnknownProvider(provider.to_owned()).into()),
}
}
Loading

0 comments on commit 272df43

Please sign in to comment.