Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/compute/compute.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{ ... }:
{
imports = [
../generic/controller-host-entry.nix
(import ./neutron.nix { inherit neutron; })
(import ./nova.nix { inherit nova; })
];
Expand Down
1 change: 1 addition & 0 deletions modules/controller/openstack-controller.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ in
{
imports = [
./generic.nix
../generic/controller-host-entry.nix
(import ./keystone.nix { inherit keystone; })
(import ./glance.nix { inherit glance; })
(import ./placement.nix { inherit placement; })
Expand Down
19 changes: 19 additions & 0 deletions modules/generic/controller-host-entry.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ lib, config, ... }:
with lib;
{
options.openstack = {
controllerIP = mkOption {
type = types.str;
description = ''
IP address of the controller. Will be used to make a /etc/hosts entry
to make the controller available via "controller".
'';
};
};

config = {
networking.extraHosts = ''
${config.openstack.controllerIP} controller controller.local
'';
};
}
34 changes: 19 additions & 15 deletions modules/testing/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,30 @@ let
common =
{ pkgs, lib, ... }:
{
system.stateVersion = lib.trivial.release;
imports = [
../generic/controller-host-entry.nix
];

services.getty.autologinUser = "root";
config = {
system.stateVersion = lib.trivial.release;

networking.extraHosts = ''
10.0.0.11 controller controller.local
'';
services.getty.autologinUser = "root";

networking = {
useDHCP = false;
networkmanager.enable = false;
useNetworkd = true;
firewall.enable = false;
};
openstack.controllerIP = "10.0.0.11";

environment.systemPackages = [
pkgs.openstackclient
];
networking = {
useDHCP = false;
networkmanager.enable = false;
useNetworkd = true;
firewall.enable = false;
};

environment.variables = adminEnv;
environment.systemPackages = [
pkgs.openstackclient
];

environment.variables = adminEnv;
};
};
in
{
Expand Down