OpenNebula / one-apps

Toolchain to build OpenNebula appliances
Apache License 2.0
12 stars 10 forks source link

Support pfSense #32

Open MATPOCKuH opened 5 years ago

MATPOCKuH commented 5 years ago

Hello!

Target pfsense are broken - pkg/postinstall.freebsd are lost.

dima@localhost:~/src/addon-context-linux$ TARGET=pfsense ./generate.sh 
cat: pkg/postinstall.freebsd: No such file or directory

I'm tried to replace path to this script with /dev/null and got a package:

dima@localhost:~/src/addon-context-linux$ TARGET=pfsense ./generate.sh 
DEPRECATION NOTICE: XZ::StreamWriter#close will automatically close the wrapped IO in the future. Use #finish to prevent that.
/var/lib/gems/2.3.0/gems/ruby-xz-0.2.3/lib/xz/stream_writer.rb:185:in `initialize'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/package/freebsd.rb:85:in `new'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/package/freebsd.rb:85:in `block in output'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/package/freebsd.rb:84:in `open'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/package/freebsd.rb:84:in `output'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/command.rb:487:in `execute'
        /var/lib/gems/2.3.0/gems/clamp-1.0.1/lib/clamp/command.rb:68:in `run'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/lib/fpm/command.rb:574:in `run'
        /var/lib/gems/2.3.0/gems/clamp-1.0.1/lib/clamp/command.rb:133:in `run'
        /var/lib/gems/2.3.0/gems/fpm-1.11.0/bin/fpm:7:in `<top (required)>'
        /usr/local/bin/fpm:22:in `load'
        /usr/local/bin/fpm:22:in `<main>'
Created package {:path=>"out/one-context-5.8.0-1.noarch.txz"}
one-context-5.8.0-1.noarch.txz

But this package can't be installed on pfsense host:

[2.4.4-RELEASE][root@pfsense]/root: pkg add one-context-5.8.0-1.noarch.txz 
Installing one-context-5.8.0-1...
pkg: wrong architecture: FreeBSD:12:x86:64 instead of FreeBSD:11:amd64

Failed to install the following 1 package(s): one-context-5.8.0-1.noarch.txz
vholer commented 5 years ago

Yes, as stated in https://github.com/OpenNebula/addon-context-linux/issues/143, the support for pfSense is not finished. I have renamed this ticket to track all the changes to make it working on pfSense.

But this package can't be installed on pfsense host:

Yes, if you build it on different version, you should "force" the installation.

openmilanese commented 4 years ago

In my opinion, the approach for pfSense is wrong. pfSense has a webgui to manage its components. At the first start it requires an interactive part for the first configuration of the wan part and possibly lan (with or without vlan). The network part among others suffers from a problem with virtio network cards. Although the current FreeBSD kernel supports virtio, a flag is needed in the advanced section about network configuration, "Disable hardware checksum offload". If you do not disable the checksum, the machines under the LAN do not correctly transmit TCP. Besides this patch, I always change the listening https port, thus freeing the classic 443 for use with a load balancer (HAproxy). The rest of the initial customizations are the usual: admin user password, timezone, NTP server, DNS server. NTP and DNS then, depending on the case, I customize them (stratum NTP and DNS resolver or forwarder), but as initial configuration it is sufficient. I also prefer to manage nat and vpn rules manually. pfSense always at the first start searches for a possible disk (vd / hd, cdrom not tested ...) with an msdos / fat32 partition containing a file on the root named "config.xml". If the file is found the first start it ends with correctly configured and reachable pfSense. I therefore recommend working on a config.xml file. This can be generated during the preparation of the image. -pfSense install and won't start -save as image -start pfSense and basic preparation -backup config.xml -point the template on the unconfigured saved image config.zip

I attach my xml with in addition the comments #OPENNEBULA where I highlight the necessary parameters.

baby-gnu commented 4 years ago

Hello.

I agree with @openmilanese about the wrong approach, this is the same problem with OPNsense.

In OPNsense, there is an API to manipulate the configuration which is stored as a single XML file /conf/config.xml and I think the contextualisation should:

MATPOCKuH commented 4 years ago

pfsense provides it's own API, that can be used for contextualization. I'm tried to write one-context for pfsense, but it's really not finished yet.

one-context.zip

salehi commented 2 years ago

This package will be really helpful.

FlorianHeigl commented 2 years ago

some thoughts - i'll try to summarize the arguments made above as well

pro config.xml

pro API

pro XML snippets

personal

kaitoan2000 commented 1 year ago

Any updates?

dann1 commented 1 year ago

Context wise we are working on a number of issues

After that we will evaluate the open issues we have and work on them accordingly. This is likely to be a top candidate.