Skip to content

Commit

Permalink
TRITON-1332 Include datacenter name in networking.json
Browse files Browse the repository at this point in the history
Reviewed by: Jason King <jason.king@joyent.com>
Approved by: Chris Burroughs <chris.burroughs@joyent.com>
  • Loading branch information
kusor committed Apr 10, 2019
1 parent 9990255 commit 9aad9f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/boot-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright (c) 2018, Joyent, Inc.
* Copyright 2019 Joyent, Inc.
*/

/*
Expand Down Expand Up @@ -60,6 +60,10 @@ function extractBootOpts(opts) {
bootOpts.dnsDomain = opts.config.dnsDomain;
}

if (opts.config.datacenterName) {
bootOpts.datacenterName = opts.config.datacenterName;
}

return bootOpts;
}

Expand Down
9 changes: 7 additions & 2 deletions lib/net-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

/*
* Copyright (c) 2018, Joyent, Inc.
* Copyright 2019 Joyent, Inc.
*/

/*
Expand Down Expand Up @@ -70,7 +70,8 @@ function generateNetConfFile(opts) {
nics: opts.nics || [],
nictags: opts.nictags,
opts_hostname: opts.hostname || '<undefined>',
overlay: opts.overlay || '<undefined>'
overlay: opts.overlay || '<undefined>',
datacenter_name: opts.datacenterName || '<undefined>'
}, 'Generating net conf file');

var conf = {
Expand All @@ -92,6 +93,10 @@ function generateNetConfFile(opts) {
conf.hostname = opts.hostname;
}

if (opts.datacenterName) {
conf.datacenter_name = opts.datacenterName;
}

// The admin nic is special in a few ways:
// - It needs to go first in the nics list (in case there are other
// vnics over the admin nic tag)
Expand Down
1 change: 1 addition & 0 deletions sapi_manifests/dhcpd/template
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"disableBootTimeFiles": true,
{{/fabric_cfg}}
"datacenterName": "{{datacenter_name}}",
"dnsDomain": "{{dns_domain}}",{{#http_pxe_boot}}
"ipxeHTTP": {{http_pxe_boot}},{{/http_pxe_boot}}{{#chainload_grub}}
"chainloadGrub": {{chainload_grub}},{{/chainload_grub}}
Expand Down

0 comments on commit 9aad9f2

Please sign in to comment.