From d190b204f001d1446807f56eed99a73f8b89e244 Mon Sep 17 00:00:00 2001 From: Antoine Eiche Date: Mon, 28 Jan 2019 15:09:48 +0100 Subject: [PATCH] Rename `novaImage` to `openstackImage` People don't necessary know `nova` is related to Openstack (it is a component of Openstack). So, it is more explicit to call it `openstackImage`. --- .../scripts/openstack/nova-image.nix | 26 ------------------- .../scripts/openstack/openstack-image.nix | 26 +++++++++++++++++++ .../{nova-config.nix => openstack-config.nix} | 2 +- nixos/tests/all-tests.nix | 3 +++ .../{nova-image.nix => openstack-image.nix} | 10 +++---- 5 files changed, 35 insertions(+), 32 deletions(-) delete mode 100644 nixos/maintainers/scripts/openstack/nova-image.nix create mode 100644 nixos/maintainers/scripts/openstack/openstack-image.nix rename nixos/modules/virtualisation/{nova-config.nix => openstack-config.nix} (98%) rename nixos/tests/{nova-image.nix => openstack-image.nix} (90%) diff --git a/nixos/maintainers/scripts/openstack/nova-image.nix b/nixos/maintainers/scripts/openstack/nova-image.nix deleted file mode 100644 index b6f3a5b1520..00000000000 --- a/nixos/maintainers/scripts/openstack/nova-image.nix +++ /dev/null @@ -1,26 +0,0 @@ -# nix-build '' -A config.system.build.novaImage --arg configuration "{ imports = [ ./nixos/maintainers/scripts/openstack/nova-image.nix ]; }" - -{ config, lib, pkgs, ... }: - -with lib; - -{ - imports = - [ ../../../modules/installer/cd-dvd/channel.nix - ../../../modules/virtualisation/nova-config.nix - ]; - - system.build.novaImage = import ../../../lib/make-disk-image.nix { - inherit lib config; - pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package - diskSize = 8192; - format = "qcow2"; - configFile = pkgs.writeText "configuration.nix" - '' - { - imports = [ ]; - } - ''; - }; - -} diff --git a/nixos/maintainers/scripts/openstack/openstack-image.nix b/nixos/maintainers/scripts/openstack/openstack-image.nix new file mode 100644 index 00000000000..4c464f43f61 --- /dev/null +++ b/nixos/maintainers/scripts/openstack/openstack-image.nix @@ -0,0 +1,26 @@ +# nix-build '' -A config.system.build.openstackImage --arg configuration "{ imports = [ ./nixos/maintainers/scripts/openstack/openstack-image.nix ]; }" + +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = + [ ../../../modules/installer/cd-dvd/channel.nix + ../../../modules/virtualisation/openstack-config.nix + ]; + + system.build.openstackImage = import ../../../lib/make-disk-image.nix { + inherit lib config; + pkgs = import ../../../.. { inherit (pkgs) system; }; # ensure we use the regular qemu-kvm package + diskSize = 8192; + format = "qcow2"; + configFile = pkgs.writeText "configuration.nix" + '' + { + imports = [ ]; + } + ''; + }; + +} diff --git a/nixos/modules/virtualisation/nova-config.nix b/nixos/modules/virtualisation/openstack-config.nix similarity index 98% rename from nixos/modules/virtualisation/nova-config.nix rename to nixos/modules/virtualisation/openstack-config.nix index c944fff96a8..7f4799d1719 100644 --- a/nixos/modules/virtualisation/nova-config.nix +++ b/nixos/modules/virtualisation/openstack-config.nix @@ -29,7 +29,7 @@ with lib; passwordAuthentication = mkDefault false; }; - systemd.services.nova-init = { + systemd.services.openstack-init = { path = [ pkgs.wget ]; description = "Fetch Metadata on startup"; wantedBy = [ "multi-user.target" ]; diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 7bc2f3076f1..e7040a52e30 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -159,6 +159,9 @@ in openldap = handleTest ./openldap.nix {}; opensmtpd = handleTest ./opensmtpd.nix {}; openssh = handleTest ./openssh.nix {}; + # openstack-image-userdata doesn't work in a sandbox as the simulated openstack instance needs network access + #openstack-image-userdata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).userdata or {}; + openstack-image-metadata = (handleTestOn ["x86_64-linux"] ./openstack-image.nix {}).metadata or {}; osquery = handleTest ./osquery.nix {}; ostree = handleTest ./ostree.nix {}; pam-oath-login = handleTest ./pam-oath-login.nix {}; diff --git a/nixos/tests/nova-image.nix b/nixos/tests/openstack-image.nix similarity index 90% rename from nixos/tests/nova-image.nix rename to nixos/tests/openstack-image.nix index 7934ab31c70..c7b28126e50 100644 --- a/nixos/tests/nova-image.nix +++ b/nixos/tests/openstack-image.nix @@ -13,15 +13,15 @@ let (import ../lib/eval-config.nix { inherit system; modules = [ - ../maintainers/scripts/openstack/nova-image.nix + ../maintainers/scripts/openstack/openstack-image.nix ../modules/testing/test-instrumentation.nix ../modules/profiles/qemu-guest.nix ]; - }).config.system.build.novaImage; + }).config.system.build.openstackImage; in { metadata = makeEc2Test { - name = "nova-ec2-metadata"; + name = "openstack-ec2-metadata"; inherit image; sshPublicKey = snakeOilPublicKey; userData = '' @@ -59,14 +59,14 @@ in { }; userdata = makeEc2Test { - name = "nova-ec2-metadata"; + name = "openstack-ec2-metadata"; inherit image; sshPublicKey = snakeOilPublicKey; userData = '' { pkgs, ... }: { imports = [ - + ];