|
|
|
@ -116,11 +116,9 @@ export const configStriker: RequestHandler< |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
job({ |
|
|
|
|
subParams: { |
|
|
|
|
file: __filename, |
|
|
|
|
line: 0, |
|
|
|
|
job_command: SERVER_PATHS.usr.sbin['anvil-configure-host'].self, |
|
|
|
|
job_data: `${fvar(1, 'domain')}=${domainName} |
|
|
|
|
file: __filename, |
|
|
|
|
job_command: SERVER_PATHS.usr.sbin['anvil-configure-host'].self, |
|
|
|
|
job_data: `${fvar(1, 'domain')}=${domainName} |
|
|
|
|
${fvar(1, 'organization')}=${organizationName} |
|
|
|
|
${fvar(1, 'prefix')}=${organizationPrefix} |
|
|
|
|
${fvar(1, 'sequence')}=${hostNumber} |
|
|
|
@ -129,32 +127,30 @@ ${fvar(2, 'gateway')}=${networkGateway} |
|
|
|
|
${fvar(2, 'host_name')}=${hostName} |
|
|
|
|
${fvar(2, 'striker_password')}=${adminPassword} |
|
|
|
|
${fvar(2, 'striker_user')}=admin${ |
|
|
|
|
networks.reduce<{ |
|
|
|
|
counters: Record<InitializeStrikerNetworkForm['type'], number>; |
|
|
|
|
result: string; |
|
|
|
|
}>( |
|
|
|
|
(reduceContainer, { interfaces, ipAddress, subnetMask, type }) => { |
|
|
|
|
const { counters } = reduceContainer; |
|
|
|
|
networks.reduce<{ |
|
|
|
|
counters: Record<InitializeStrikerNetworkForm['type'], number>; |
|
|
|
|
result: string; |
|
|
|
|
}>( |
|
|
|
|
(reduceContainer, { interfaces, ipAddress, subnetMask, type }) => { |
|
|
|
|
const { counters } = reduceContainer; |
|
|
|
|
|
|
|
|
|
counters[type] = counters[type] ? counters[type] + 1 : 1; |
|
|
|
|
counters[type] = counters[type] ? counters[type] + 1 : 1; |
|
|
|
|
|
|
|
|
|
const networkShortName = `${type}${counters[type]}`; |
|
|
|
|
const networkShortName = `${type}${counters[type]}`; |
|
|
|
|
|
|
|
|
|
reduceContainer.result += ` |
|
|
|
|
reduceContainer.result += ` |
|
|
|
|
${fvar(2, `${networkShortName}_ip`)}=${ipAddress} |
|
|
|
|
${fvar(2, `${networkShortName}_subnet_mask`)}=${subnetMask} |
|
|
|
|
${buildNetworkLinks(2, networkShortName, interfaces)}`;
|
|
|
|
|
|
|
|
|
|
return reduceContainer; |
|
|
|
|
}, |
|
|
|
|
{ counters: {}, result: '' }, |
|
|
|
|
).result |
|
|
|
|
}`,
|
|
|
|
|
job_name: 'configure::network', |
|
|
|
|
job_title: 'job_0001', |
|
|
|
|
job_description: 'job_0071', |
|
|
|
|
job_progress: 0, |
|
|
|
|
}, |
|
|
|
|
return reduceContainer; |
|
|
|
|
}, |
|
|
|
|
{ counters: {}, result: '' }, |
|
|
|
|
).result |
|
|
|
|
}`,
|
|
|
|
|
job_name: 'configure::network', |
|
|
|
|
job_title: 'job_0001', |
|
|
|
|
job_description: 'job_0071', |
|
|
|
|
}); |
|
|
|
|
} catch (subError) { |
|
|
|
|
console.log(`Failed to queue striker initialization; CAUSE: ${subError}`); |
|
|
|
|