Skip to content

Commit

Permalink
Merge pull request #83 from fortinet/patch_3.3.0_configset_update_for…
Browse files Browse the repository at this point in the history
…_fos_7.0.1

add a workaround for the primary/secondary terminology changes
  • Loading branch information
JaydenLiang authored Sep 24, 2021
2 parents 4d88666 + 6a21bd0 commit 90f677a
Show file tree
Hide file tree
Showing 3 changed files with 2,192 additions and 33 deletions.
4 changes: 4 additions & 0 deletions fortigate-autoscale/assets/configset/baseconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ config system auto-scale
set status enable
set sync-interface "{SYNC_INTERFACE}"
set hb-interval "{HEART_BEAT_INTERVAL}"
# set role command has changed the options since FOS 7.0.1 The 'command fail' errors can be safely ignored if you see them.
# set role master/slave is available before FOS 7.0.1
set role master
# set role primary/secondary is available since FOS 7.0.1
set role primary
set callback-url "{CALLBACK_URL}"
set psksecret "{PSK_SECRET}"
end
14 changes: 10 additions & 4 deletions fortigate-autoscale/fortigate-bootstrap-config-strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,11 +399,17 @@ export abstract class FortiGateBootstrapConfigStrategy implements BootstrapConfi
(primaryVm && `\n set master-ip ${primaryVm.primaryPrivateIpAddress}`) || '';
const conf = this.processConfig(config, { '@device': targetVm });
// TODO: fix it when primary/secondary terminology has been used in FOS CLI command.
// NOTE: primary/secondary terminology is only available since FOS 7.0.1
return Promise.resolve(
conf.replace(
new RegExp('set role master', 'gm'),
`set role slave${setPrimaryIpSection}`
)
conf
.replace(
new RegExp('set role master', 'gm'),
`set role slave${setPrimaryIpSection}`
)
.replace(
new RegExp('set role primary', 'gm'),
`set role secondary${setPrimaryIpSection}`
)
);
}
}
Loading

0 comments on commit 90f677a

Please sign in to comment.