From 16f7eb681a29052e2a8a73d08fdad7efd16beec3 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Wed, 27 Mar 2019 14:28:54 -0400 Subject: [PATCH] *: rename to Afterburn --- .github/ISSUE_TEMPLATE/bug.md | 6 +- .github/ISSUE_TEMPLATE/feature.md | 4 +- Cargo.lock | 62 +++++------ Cargo.toml | 12 +-- Makefile | 2 +- README.md | 108 ++++++++++---------- docs/container-linux-legacy.md | 8 +- docs/distro.md | 6 +- docs/release-guide.md | 2 +- src/main.rs | 2 +- src/providers/azure/mod.rs | 2 +- src/providers/cloudstack/configdrive.rs | 2 +- src/providers/mod.rs | 12 ++- systemd/.gitignore | 2 +- systemd/afterburn-sshkeys@.service.in | 11 ++ systemd/afterburn.service | 10 ++ systemd/coreos-metadata-sshkeys@.service.in | 11 -- systemd/coreos-metadata.service | 10 -- 18 files changed, 140 insertions(+), 132 deletions(-) create mode 100644 systemd/afterburn-sshkeys@.service.in create mode 100644 systemd/afterburn.service delete mode 100644 systemd/coreos-metadata-sshkeys@.service.in delete mode 100644 systemd/coreos-metadata.service diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md index 79cd608e..11522fcf 100644 --- a/.github/ISSUE_TEMPLATE/bug.md +++ b/.github/ISSUE_TEMPLATE/bug.md @@ -1,17 +1,17 @@ --- name: Bug report -about: Report an issue with coreos-metadata +about: Report an issue with Afterburn --- # Bug # ## Operating System Version ## -## coreos-metadata Version ## +## Afterburn Version ## ## Environment ## -What hardware/cloud provider/hypervisor is being used to run coreos-metadata? +What hardware/cloud provider/hypervisor is being used to run Afterburn? ## Expected Behavior ## diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md index d8a1598d..83f61620 100644 --- a/.github/ISSUE_TEMPLATE/feature.md +++ b/.github/ISSUE_TEMPLATE/feature.md @@ -1,13 +1,13 @@ --- name: Feature request -about: Suggest an enhancement to coreos-metadata +about: Suggest an enhancement to Afterburn --- # Feature Request # ## Environment ## -What hardware/cloud provider/hypervisor is being used to run coreos-metadata? +What hardware/cloud provider/hypervisor is being used to run Afterburn? ## Desired Feature ## diff --git a/Cargo.lock b/Cargo.lock index bf5b5e7d..faabfed8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,6 +3,37 @@ name = "adler32" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "afterburn" +version = "3.1.1-alpha.0" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "mockito 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssh-keys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.20 (registry+https://github.com/rust-lang/crates.io-index)", + "pnet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde-xml-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", + "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slog-term 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "update-ssh-keys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "users 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "aho-corasick" version = "0.6.9" @@ -174,37 +205,6 @@ dependencies = [ "libc 0.2.47 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "coreos-metadata" -version = "3.1.1-alpha.0" -dependencies = [ - "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", - "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hostname 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "ipnetwork 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", - "mockito 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssh-keys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl 0.10.20 (registry+https://github.com/rust-lang/crates.io-index)", - "pnet 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)", - "reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde-xml-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.89 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", - "slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slog-scope 4.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "slog-term 2.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "update-ssh-keys 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "users 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crc32fast" version = "1.1.2" diff --git a/Cargo.toml b/Cargo.toml index 28335ae3..8aae28e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "coreos-metadata" -repository = "https://github.com/coreos/coreos-metadata" +name = "afterburn" +repository = "https://github.com/coreos/afterburn" license = "Apache-2.0" authors = [ "Stephen Demos ", "Luca Bruno " ] -description = "A simple cloud-provider metadata agent" +description = "A simple cloud provider agent" version = "3.1.1-alpha.0" [[bin]] -name = "coreos-metadata" +name = "afterburn" path = "src/main.rs" [profile.release] @@ -54,7 +54,7 @@ sign-commit = true upload-doc = false disable-push = true disable-publish = true -pre-release-commit-message = "cargo: coreos-metadata release {{version}}" +pre-release-commit-message = "cargo: Afterburn release {{version}}" pro-release-commit-message = "cargo: version bump to {{version}}" -tag-message = "coreos-metadata v{{version}}" +tag-message = "Afterburn v{{version}}" tag-prefix = "v" diff --git a/Makefile b/Makefile index 8efa520f..7b011b16 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ PREFIX ?= /usr DEFAULT_INSTANCE ?= core -units = $(addprefix systemd/,coreos-metadata.service coreos-metadata-sshkeys@.service) +units = $(addprefix systemd/,afterburn.service afterburn-sshkeys@.service) %.service: %.service.in sed -e 's,@DEFAULT_INSTANCE@,'$(DEFAULT_INSTANCE)',' < $< > $@.tmp && mv $@.tmp $@ diff --git a/README.md b/README.md index 383eee3c..840554f0 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# coreos-metadata +# Afterburn -[![Build Status](https://travis-ci.org/coreos/coreos-metadata.svg?branch=master)](https://travis-ci.org/coreos/coreos-metadata) +[![Build Status](https://travis-ci.org/coreos/afterburn.svg?branch=master)](https://travis-ci.org/coreos/afterburn) ![minimum rust 1.29](https://img.shields.io/badge/rust-1.29%2B-orange.svg) This is a small utility, typically used in conjunction with [Ignition][ignition], which reads metadata from a given cloud-provider and applies it to the system. -This can include adding SSH keys and writing cloud-specific attributes into an environment file (e.g. `/run/metadata/coreos`), which can then be consumed by systemd service units via `EnvironmentFile=`. +This can include adding SSH keys and writing cloud-specific attributes into an environment file (e.g. `/run/metadata/afterburn`), which can then be consumed by systemd service units via `EnvironmentFile=`. ## Support @@ -14,87 +14,87 @@ On CoreOS Container Linux, the supported providers and metadata are [somewhat di - aws - SSH Keys - Attributes - - COREOS_AWS_HOSTNAME - - COREOS_AWS_PUBLIC_HOSTNAME - - COREOS_AWS_IPV4_LOCAL - - COREOS_AWS_IPV4_PUBLIC - - COREOS_AWS_AVAILABILITY_ZONE - - COREOS_AWS_INSTANCE_ID - - COREOS_AWS_REGION + - AFTERBURN_AWS_HOSTNAME + - AFTERBURN_AWS_PUBLIC_HOSTNAME + - AFTERBURN_AWS_IPV4_LOCAL + - AFTERBURN_AWS_IPV4_PUBLIC + - AFTERBURN_AWS_AVAILABILITY_ZONE + - AFTERBURN_AWS_INSTANCE_ID + - AFTERBURN_AWS_REGION - azure - SSH Keys - Attributes - - COREOS_AZURE_IPV4_DYNAMIC - - COREOS_AZURE_IPV4_VIRTUAL + - AFTERBURN_AZURE_IPV4_DYNAMIC + - AFTERBURN_AZURE_IPV4_VIRTUAL - cloudstack-configdrive - SSH Keys - Attributes - - COREOS_CLOUDSTACK_AVAILABILITY_ZONE - - COREOS_CLOUDSTACK_INSTANCE_ID - - COREOS_CLOUDSTACK_SERVICE_OFFERING - - COREOS_CLOUDSTACK_CLOUD_IDENTIFIER - - COREOS_CLOUDSTACK_LOCAL_HOSTNAME - - COREOS_CLOUDSTACK_VM_ID + - AFTERBURN_CLOUDSTACK_AVAILABILITY_ZONE + - AFTERBURN_CLOUDSTACK_INSTANCE_ID + - AFTERBURN_CLOUDSTACK_SERVICE_OFFERING + - AFTERBURN_CLOUDSTACK_CLOUD_IDENTIFIER + - AFTERBURN_CLOUDSTACK_LOCAL_HOSTNAME + - AFTERBURN_CLOUDSTACK_VM_ID - cloudstack-metadata - SSH Keys - Attributes - - COREOS_CLOUDSTACK_AVAILABILITY_ZONE - - COREOS_CLOUDSTACK_CLOUD_IDENTIFIER - - COREOS_CLOUDSTACK_HOSTNAME - - COREOS_CLOUDSTACK_INSTANCE_ID - - COREOS_CLOUDSTACK_IPV4_LOCAL - - COREOS_CLOUDSTACK_IPV4_PUBLIC - - COREOS_CLOUDSTACK_LOCAL_HOSTNAME - - COREOS_CLOUDSTACK_PUBLIC_HOSTNAME - - COREOS_CLOUDSTACK_SERVICE_OFFERING - - COREOS_CLOUDSTACK_VM_ID + - AFTERBURN_CLOUDSTACK_AVAILABILITY_ZONE + - AFTERBURN_CLOUDSTACK_CLOUD_IDENTIFIER + - AFTERBURN_CLOUDSTACK_HOSTNAME + - AFTERBURN_CLOUDSTACK_INSTANCE_ID + - AFTERBURN_CLOUDSTACK_IPV4_LOCAL + - AFTERBURN_CLOUDSTACK_IPV4_PUBLIC + - AFTERBURN_CLOUDSTACK_LOCAL_HOSTNAME + - AFTERBURN_CLOUDSTACK_PUBLIC_HOSTNAME + - AFTERBURN_CLOUDSTACK_SERVICE_OFFERING + - AFTERBURN_CLOUDSTACK_VM_ID - digitalocean - SSH Keys - Network Configs - Attributes - - COREOS_DIGITALOCEAN_HOSTNAME - - COREOS_DIGITALOCEAN_IPV4_ANCHOR_0 - - COREOS_DIGITALOCEAN_IPV4_PUBLIC_0 - - COREOS_DIGITALOCEAN_IPV4_PRIVATE_0 - - COREOS_DIGITALOCEAN_IPV6_PUBLIC_0 - - COREOS_DIGITALOCEAN_IPV6_PRIVATE_0 - - COREOS_DIGITALOCEAN_REGION + - AFTERBURN_DIGITALOCEAN_HOSTNAME + - AFTERBURN_DIGITALOCEAN_IPV4_ANCHOR_0 + - AFTERBURN_DIGITALOCEAN_IPV4_PUBLIC_0 + - AFTERBURN_DIGITALOCEAN_IPV4_PRIVATE_0 + - AFTERBURN_DIGITALOCEAN_IPV6_PUBLIC_0 + - AFTERBURN_DIGITALOCEAN_IPV6_PRIVATE_0 + - AFTERBURN_DIGITALOCEAN_REGION - gcp - SSH Keys - Attributes - - COREOS_GCP_HOSTNAME - - COREOS_GCP_IP_EXTERNAL_0 - - COREOS_GCP_IP_LOCAL_0 + - AFTERBURN_GCP_HOSTNAME + - AFTERBURN_GCP_IP_EXTERNAL_0 + - AFTERBURN_GCP_IP_LOCAL_0 - openstack-metadata - SSH Keys - Attributes - - COREOS_OPENSTACK_HOSTNAME - - COREOS_OPENSTACK_IPV4_LOCAL - - COREOS_OPENSTACK_IPV4_PUBLIC - - COREOS_OPENSTACK_INSTANCE_ID + - AFTERBURN_OPENSTACK_HOSTNAME + - AFTERBURN_OPENSTACK_IPV4_LOCAL + - AFTERBURN_OPENSTACK_IPV4_PUBLIC + - AFTERBURN_OPENSTACK_INSTANCE_ID - packet - SSH Keys - Network Configs - Attributes - - COREOS_PACKET_HOSTNAME - - COREOS_PACKET_IPV4_PUBLIC_0 - - COREOS_PACKET_IPV4_PRIVATE_0 - - COREOS_PACKET_IPV6_PUBLIC_0 + - AFTERBURN_PACKET_HOSTNAME + - AFTERBURN_PACKET_IPV4_PUBLIC_0 + - AFTERBURN_PACKET_IPV4_PRIVATE_0 + - AFTERBURN_PACKET_IPV6_PUBLIC_0 - vagrant-virtualbox - Attributes - - COREOS_VAGRANT_VIRTUALBOX_PRIVATE_IPV4 - - COREOS_VAGRANT_VIRTUALBOX_HOSTNAME + - AFTERBURN_VAGRANT_VIRTUALBOX_PRIVATE_IPV4 + - AFTERBURN_VAGRANT_VIRTUALBOX_HOSTNAME 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 coreos-metadata: +These can be safely used by external providers on a platform not supported by Afterburn: - custom - Attributes - - COREOS_CUSTOM_HOSTNAME - - COREOS_CUSTOM_PUBLIC_IPV4 - - COREOS_CUSTOM_PRIVATE_IPV4 - - COREOS_CUSTOM_PUBLIC_IPV6 - - COREOS_CUSTOM_PRIVATE_IPV6 + - AFTERBURN_CUSTOM_HOSTNAME + - AFTERBURN_CUSTOM_PUBLIC_IPV4 + - AFTERBURN_CUSTOM_PRIVATE_IPV4 + - AFTERBURN_CUSTOM_PUBLIC_IPV6 + - AFTERBURN_CUSTOM_PRIVATE_IPV6 [ignition]: https://github.com/coreos/ignition [custom-metadata]: https://github.com/coreos/container-linux-config-transpiler/blob/v0.8.0/doc/dynamic-data.md#custom-metadata-providers diff --git a/docs/container-linux-legacy.md b/docs/container-linux-legacy.md index 193d70bb..09638948 100644 --- a/docs/container-linux-legacy.md +++ b/docs/container-linux-legacy.md @@ -1,9 +1,11 @@ -# coreos-metadata on CoreOS Container Linux +# Afterburn on CoreOS Container Linux This is a small utility, typically used in conjunction with [Ignition][ignition], which reads metadata from a given cloud-provider and applies it to the system. This can include adding SSH keys and writing cloud-specific attributes into an environment file (e.g. `/run/metadata/coreos`), which can then be consumed by systemd service units via `EnvironmentFile=`. -coreos-metadata can be built with the `cl-legacy` feature to enable legacy behavior for Container Linux. +On Container Linux, for historical reasons, Afterburn is usually called "coreos-metadata". + +Afterburn can be built with the `cl-legacy` feature to enable legacy behavior for Container Linux. Other distros should not enable this feature. ## Support @@ -85,7 +87,7 @@ On Container Linux, the supported cloud providers and their respective metadata - COREOS_VAGRANT_VIRTUALBOX_HOSTNAME 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 coreos-metadata: +These can be safely used by external providers on a platform not supported by Afterburn: - custom - Attributes diff --git a/docs/distro.md b/docs/distro.md index 6cf20f7b..7d368692 100644 --- a/docs/distro.md +++ b/docs/distro.md @@ -1,11 +1,11 @@ -# Integrating coreos-metadata into a distribution +# Integrating Afterburn into a distribution ## SSH keys -The `--ssh-keys` option (invoked by `coreos-metadata-sshkeys@.service`) writes SSH keys to `~user/.ssh/authorized_keys.d/coreos-metadata`. +The `--ssh-keys` option (invoked by `afterburn-sshkeys@.service`) writes SSH keys to `~user/.ssh/authorized_keys.d/afterburn`. For sshd to respect this file, it must be configured with an `AuthorizedKeysCommand` that reads files from the `authorized_keys.d` directory. Alternatively, sshd can be configured to read the fragment file directly: ``` -AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/coreos-metadata +AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys.d/afterburn ``` diff --git a/docs/release-guide.md b/docs/release-guide.md index 44fa4145..d21a0df3 100644 --- a/docs/release-guide.md +++ b/docs/release-guide.md @@ -72,7 +72,7 @@ For each release to be published, proceed as follows: #### 6. Assemble vendor tarball and publish a Release * `cargo vendor` -* `tar -czf target/coreos-metadata-${RELEASE_VER}-vendor.tar.gz vendor` +* `tar -czf target/afterburn-${RELEASE_VER}-vendor.tar.gz vendor` * Open a web browser and create a GitHub Release for the tag above * Attach the `vendor.tar.gz` (located under `target/`) to the current Release * Write a short changelog and publish the Release diff --git a/src/main.rs b/src/main.rs index 4f2588bc..3b5a888b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,7 +149,7 @@ fn init() -> Result { // prepends the hyphens // the preprocessing will probably convert any short flags it finds into // long ones - let matches = App::new("coreos-metadata") + let matches = App::new("Afterburn") .version(crate_version!()) .arg( Arg::with_name("attributes") diff --git a/src/providers/azure/mod.rs b/src/providers/azure/mod.rs index 3dfc26d5..1ec1b756 100644 --- a/src/providers/azure/mod.rs +++ b/src/providers/azure/mod.rs @@ -36,7 +36,7 @@ static HDR_VERSION: &str = "x-ms-version"; static HDR_CIPHER_NAME: &str = "x-ms-cipher-name"; static HDR_CERT: &str = "x-ms-guest-agent-public-x509-cert"; -const MS_AGENT_NAME: &str = "com.coreos.metadata"; +const MS_AGENT_NAME: &str = "com.coreos.afterburn"; const MS_VERSION: &str = "2012-11-30"; const SMIME_HEADER: &str = "\ MIME-Version:1.0 diff --git a/src/providers/cloudstack/configdrive.rs b/src/providers/cloudstack/configdrive.rs index 1eba4602..6aea2e42 100644 --- a/src/providers/cloudstack/configdrive.rs +++ b/src/providers/cloudstack/configdrive.rs @@ -37,7 +37,7 @@ impl ConfigDrive { // if not try and mount with each of the labels let target = - TempDir::new("coreos-metadata").chain_err(|| "failed to create temporary directory")?; + TempDir::new("afterburn").chain_err(|| "failed to create temporary directory")?; ConfigDrive::mount_ro( &Path::new("/dev/disk/by-label/").join(CONFIG_DRIVE_LABEL_1), target.path(), diff --git a/src/providers/mod.rs b/src/providers/mod.rs index 638d4312..91d12281 100644 --- a/src/providers/mod.rs +++ b/src/providers/mod.rs @@ -14,7 +14,7 @@ //! Providers //! -//! These are the providers which coreos-metadata knows how to retrieve metadata +//! These are the providers which Afterburn knows how to retrieve metadata //! from. Internally, they handle the ins and outs of each providers metadata //! services, and externally, they provide a function to fetch that metadata in //! a regular format. @@ -43,6 +43,11 @@ use users::{self, User}; use errors::*; use network; +#[cfg(not(feature = "cl-legacy"))] +const ENV_PREFIX: &str = "AFTERBURN_"; +#[cfg(feature = "cl-legacy")] +const ENV_PREFIX: &str = "COREOS_"; + fn create_file(filename: &str) -> Result { let file_path = Path::new(&filename); // create the directories if they don't exist @@ -75,6 +80,7 @@ fn write_ssh_keys(user: User, ssh_keys: Vec) -> Result<()> { .into_iter() .map(|key| AuthorizedKeyEntry::Valid { key }) .collect::>(); + // legacy name for legacy mode authorized_keys_dir.add_keys("coreos-metadata", entries, true, true)?; // write the changes and sync the directory @@ -101,7 +107,7 @@ fn write_ssh_keys(user: User, ssh_keys: Vec) -> Result<()> { // get paths let dir_path = user.home_dir().join(".ssh").join("authorized_keys.d"); - let file_name = "coreos-metadata"; + let file_name = "afterburn"; let file_path = &dir_path.join(file_name); if !ssh_keys.is_empty() { @@ -170,7 +176,7 @@ pub trait MetadataProvider { fn write_attributes(&self, attributes_file_path: String) -> Result<()> { let mut attributes_file = create_file(&attributes_file_path)?; for (k, v) in self.attributes()? { - writeln!(&mut attributes_file, "COREOS_{}={}", k, v).chain_err(|| { + writeln!(&mut attributes_file, "{}{}={}", ENV_PREFIX, k, v).chain_err(|| { format!("failed to write attributes to file {:?}", attributes_file) })?; } diff --git a/systemd/.gitignore b/systemd/.gitignore index c4b321cf..900cdb48 100644 --- a/systemd/.gitignore +++ b/systemd/.gitignore @@ -1 +1 @@ -coreos-metadata-sshkeys@.service +afterburn-sshkeys@.service diff --git a/systemd/afterburn-sshkeys@.service.in b/systemd/afterburn-sshkeys@.service.in new file mode 100644 index 00000000..3bc8ff4a --- /dev/null +++ b/systemd/afterburn-sshkeys@.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Afterburn (SSH Keys) + +[Service] +Type=oneshot +Environment=AFTERBURN_OPT_PROVIDER=--cmdline +ExecStart=/usr/bin/afterburn ${AFTERBURN_OPT_PROVIDER} --ssh-keys=%i + +[Install] +DefaultInstance=@DEFAULT_INSTANCE@ +RequiredBy=multi-user.target diff --git a/systemd/afterburn.service b/systemd/afterburn.service new file mode 100644 index 00000000..a1e57719 --- /dev/null +++ b/systemd/afterburn.service @@ -0,0 +1,10 @@ +[Unit] +Description=Afterburn (Metadata) + +[Service] +Type=oneshot +Environment=AFTERBURN_OPT_PROVIDER=--cmdline +ExecStart=/usr/bin/afterburn ${AFTERBURN_OPT_PROVIDER} --attributes=/run/metadata/afterburn + +[Install] +RequiredBy=metadata.target diff --git a/systemd/coreos-metadata-sshkeys@.service.in b/systemd/coreos-metadata-sshkeys@.service.in deleted file mode 100644 index 4d543256..00000000 --- a/systemd/coreos-metadata-sshkeys@.service.in +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=CoreOS Metadata Agent (SSH Keys) - -[Service] -Type=oneshot -Environment=COREOS_METADATA_OPT_PROVIDER=--cmdline -ExecStart=/usr/bin/coreos-metadata ${COREOS_METADATA_OPT_PROVIDER} --ssh-keys=%i - -[Install] -DefaultInstance=@DEFAULT_INSTANCE@ -RequiredBy=multi-user.target diff --git a/systemd/coreos-metadata.service b/systemd/coreos-metadata.service deleted file mode 100644 index 29717748..00000000 --- a/systemd/coreos-metadata.service +++ /dev/null @@ -1,10 +0,0 @@ -[Unit] -Description=CoreOS Metadata Agent - -[Service] -Type=oneshot -Environment=COREOS_METADATA_OPT_PROVIDER=--cmdline -ExecStart=/usr/bin/coreos-metadata ${COREOS_METADATA_OPT_PROVIDER} --attributes=/run/metadata/coreos - -[Install] -RequiredBy=metadata.target