ndejong / pfsense_fauxapi

REST based API interface for pfSense 2.3.x and 2.4.x to facilitate devops
Apache License 2.0
354 stars 61 forks source link

Rules created using fauxapi not syncing to slave in cluster #53

Closed jdenoy closed 4 years ago

jdenoy commented 4 years ago

Hello,

I'm using a cluster of two pfsense using the HA Sync. I create new rules without a problem on the master, but there is no HA Sync being done.

Is there a function to use to start the sync between the two devices?

Thxs

ndejong commented 4 years ago

Hi @jdenoy

Have extensively dealt with master-slave pfSense clusters but do not have one to work with and debug this with at the moment.

Reading though what you have it sounds like there is some other callback that needs to occur to invoke the sync to the secondary - I'd suggest you try issuing a send_event with POST data filter sync which is the pfSense way of invoking the sync under the hood

Let us know how it goes.

jdenoy commented 4 years ago

hello @ndejong,

thanks, that seems to have worked. Are you aware of a list of send_event function somewhere else than the code? probably want to try syncing other rules thatn filter across HA Sync.

Thanks

ndejong commented 4 years ago

I've grappled with this send_event discoverability problem a few times and the best way I know to tease this out of the codebase is as such -

ndejong@computer:~/pfsense$ grep -r "send_event(" | cut -d':' -f2 | tr -d "\t" | sort -u
$retval |= send_event("service reload dns");
function send_event($cmd) {
send_event("filter reload");
send_event("filter sync");
send_event("interface all reload");
send_event("interface newip {$iface}");
send_event("interface reconfigure {$interface}");
send_event("interface reconfigure {$reloadif}");
send_event("service reload all");
send_event("service reload dyndns {$interface}");
send_event("service reload dyndnsall");
send_event("service reload ipsecdns");
send_event("service reload packages");
send_event("service reload sshd");
send_event("service restart packages");
send_event("service restart sshd");
send_event("service restart webgui");
send_event("service sync alias {$name}");
send_event("service sync vouchers");

Here you can see all the send_event actions called by the pfSense code itself