Deliver master.conf to a node that has no Varaverk on it yet, which is the node that needs it
Phase 1 exists to hand the partner its identity before the install, but the push refused any host without varaverk.cfg — so the conf could only ever reach a node that no longer needed it to be told who it was. It now resolves the remote's conf directory across both install layouts and creates the internal one when neither exists.
This commit is contained in:
@@ -176,18 +176,41 @@ if (!empty($jfContainer)) {
|
||||
];
|
||||
}
|
||||
|
||||
// ── master.conf pull (partner servers only) ───────────────────────────────────────────────────
|
||||
// ── master.conf delivery (partner servers only) ───────────────────────────────────────────────
|
||||
//
|
||||
// The question is whether this host HAS the owner's master.conf, not whether it went and
|
||||
// fetched one. There are two ways it arrives and only one of them used to count:
|
||||
//
|
||||
// pull — this host ran 'Pull from HOST1', which sets master_conf_pulled in the setup state.
|
||||
// push — HOST1 sent it during Phase 1 of onboarding, before this host even had Varaverk
|
||||
// installed. Nothing on this side runs, so no flag is written here.
|
||||
//
|
||||
// Keying solely off the pull flag meant a node whose conf had been seeded by Phase 1 —
|
||||
// populated, correct, naming both hosts — was told "Not yet pulled from HOST1" and offered a
|
||||
// button to fetch what it already had.
|
||||
//
|
||||
// The push leaves its own evidence: Phase 1 ends by writing <THIS_HOST>_PHASE1_DONE into the
|
||||
// owner's setup state and pushing that file here, so the flag can only be present on this
|
||||
// machine because the owner completed a push AT this machine. That is the discriminator.
|
||||
//
|
||||
// A populated HOST1 line is deliberately NOT the test. The wizard's manual partner path writes
|
||||
// HOST1 and HOST2 into the LOCAL template conf from what the operator typed, which would make
|
||||
// a template look delivered and hide the one button that fixes it.
|
||||
if ($hostId !== 'host1' && $hostId !== 'unknown') {
|
||||
$state = vv_setup_state_read();
|
||||
$pulled = !empty($state['master_conf_pulled']);
|
||||
$state = vv_setup_state_read();
|
||||
$pulled = !empty($state['master_conf_pulled']);
|
||||
// Both spellings, for the same reason the partnership item below accepts both.
|
||||
$pushed = !empty($state[$hostIdUp . '_PHASE1_DONE']) || !empty($state[$hostId . '_phase1_done']);
|
||||
$items[] = [
|
||||
'id' => 'master_conf',
|
||||
'label' => 'master.conf',
|
||||
'ok' => $pulled,
|
||||
'ok' => $pulled || $pushed,
|
||||
'detail' => $pulled
|
||||
? 'Synced from HOST1'
|
||||
: ($host1 ? "Not yet pulled from $host1" : 'HOST1 hostname not set in master.conf'),
|
||||
'action' => (!$pulled && $host1) ? 'pull_master' : null,
|
||||
? "Pulled from $host1"
|
||||
: ($pushed
|
||||
? "Seeded by $host1 — identity read from it"
|
||||
: ($host1 ? "Not yet pulled from $host1" : 'HOST1 hostname not set in master.conf')),
|
||||
'action' => (!$pulled && !$pushed && $host1) ? 'pull_master' : null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user