Class: VagrantPlugins::ProviderZone::QGA::OpnsenseBackend

Inherits:
BaseBackend
  • Object
show all
Defined in:
lib/vagrant-zones/qga/opnsense_backend.rb

Overview

OPNsense detection only for v1; full integration via configctl + config.xml XPath is TODO. TODO(opnsense): implement configctl + /conf/config.xml XPath editing,

then run `configctl interface reconfigure all`.

Constant Summary collapse

OPNSENSE_VERSION_DIR =
'/usr/local/opnsense/version'

Instance Method Summary collapse

Methods inherited from BaseBackend

#cleanup, #name, #verify

Instance Method Details

#applyObject



18
19
20
21
# File 'lib/vagrant-zones/qga/opnsense_backend.rb', line 18

def apply(*)
  raise Errors::QGABackendNotImplemented, backend: 'opnsense',
                                          details: 'OPNsense network configuration via configctl + config.xml is not yet implemented in vagrant-zones. Track in repository issues.'
end

#detect?(qga) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/vagrant-zones/qga/opnsense_backend.rb', line 12

def detect?(qga)
  qga.exec('/usr/bin/test', args: ['-d', OPNSENSE_VERSION_DIR], timeout: 10)[:exitcode].zero?
rescue StandardError
  false
end