-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Central database for internal IP addresses
- Implements a common database for internal IP addresses - All VMs read this to get it's assigned IP - Resolves: https://jira.tii.ae/browse/SSRCSP-5674 Signed-off-by: Ganga Ram <[email protected]>
- Loading branch information
Showing
16 changed files
with
122 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
let | ||
hostsEntries = [ | ||
{ | ||
ip = 1; | ||
name = "net-vm"; | ||
} | ||
{ | ||
ip = 2; | ||
name = "ghaf-host"; | ||
} | ||
{ | ||
ip = 3; | ||
name = "gui-vm"; | ||
} | ||
{ | ||
ip = 4; | ||
name = "ids-vm"; | ||
} | ||
{ | ||
ip = 5; | ||
name = "audio-vm"; | ||
} | ||
{ | ||
ip = 10; | ||
name = "admin-vm"; | ||
} | ||
{ | ||
ip = 100; | ||
name = "chrome-vm"; | ||
} | ||
{ | ||
ip = 101; | ||
name = "gala-vm"; | ||
} | ||
{ | ||
ip = 102; | ||
name = "zathura-vm"; | ||
} | ||
{ | ||
ip = 103; | ||
name = "comms-vm"; | ||
} | ||
{ | ||
ip = 104; | ||
name = "business-vm"; | ||
} | ||
]; | ||
# Create a lookup map from entries | ||
lookupMap = builtins.listToAttrs ( | ||
map (entry: { | ||
inherit (entry) name; | ||
value = entry.ip; | ||
}) hostsEntries | ||
); | ||
|
||
# Function to find the corresponding IP address by name | ||
ipByName = name: lookupMap.${name}; | ||
|
||
in | ||
{ | ||
inherit ipByName; | ||
inherit hostsEntries; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters