Package: ezjailremote
ezjail-remoteis a ‘remote control’ and convenience wrapper for theezjail-admincommand of the most excellentezjailtool (which in turn is itself a convenience wrapper forjails,FreeBSD’s leight-weight virtualization solution).Its main features are:more sophisticated support for flavours, i.e. interactive configuration and/or templating as opposed to ezjail’s hardcoded flavoursyou can ssh into jails created byezjail-remoteimmediately upon creation (no more manual mucking about with sshd config or uploading your public key!)unlikeezjail-admin,ezjail-remoteis not installed on the jail host, but on your local machine. This meansit doesn’t introduce any further dependencies on the jail host whatsoever(ezjail itself purposefully limits itself tosh)...note: In general ezjail-remote tries to keep up with ezjail development, so unless stated otherwise, it requires (and by default also installs) the latest version of ezjail (version 3.2.2 as of this writing).Usageezjail-remote uses thefabriclibrary to remotely run its tasks. Basically it provides a so-calledfabfilethat contains all of the commands ofezjail-admin.This means that its usage differs slightly from that ofezjail-admin. In particular, you provide the hostname of the jail server via the-Hswitch and the parameters for the command (such as the name of the jail etc) separated with a colon, like so:ezjail-remote -H host(s) <COMMAND>:param1,param2,param3or:ezjail-remote -H host(s) <COMMAND>:param1=foo,param3=barSee thefull documentation of what fabric has to offer here.In particualar, you can…runezjail-remote--helpto see a list of the availableoptionsrunezjail-remote-lto see a list of the availablecommandsrunezjail-remote-dCOMMANDto see a detailed description of a commandAs a side effect of using fabric, you can run ezjail-admin commands against multiple jailhosts at the same time.Bootstrappingezjail-remote doesn’t only make it easy to create and manage jails, it also helps you set up a jailhost environment from scratch. This is done with thebootstrapandinstallcommands.To successfully run the bootstrap command the following requirements need to be met on the host:sshd is up and runningssh login for root is (temporarily) enabledcurrently we also require an internet connection (to install ezjail) but this will eventually be replaced with uploading a copy of ezjail.For example (logged in as root on the console):echo 'PermitRootLogin yes' >> /etc/ssh/sshd_config
echo 'ifconfig_em0=DHCP' >> /etc/rc.conf
passwd # give yourself a TEMP_PASSWORD
dhclient em0 # note the IP_ADDR you get
/etc/rc.d/sshd onestartNow you can run the bootstrap command using the temporary password you gave yourself:ezjail-remote -H IP_ADDR bootstrapThisdisables root loginpermanently enables SSH for the jail host (and limits it to the primary IP address)creates an admin user with your username and public SSH key..note: Before installing ezjail with theinstallcommand you may want to set up additional things, such as ZFS pools, network interface aliases, etc.To install ezjail you can use theinstallcommand, which either installs it from the ports or from CVS (for the brave):ezjail-remote -H IP_ADDR installIf you want to use a CVS snapshot:ezjail-remote -H IP_ADDR install:source=cvsIf you want to use ZFS (and you should!) supply the pool it should use via the jailzfs parameter:ezjail-remote -H IP_ADDR install:jailzfs='jails/ezjail'CommandsIn its simplest form, ezjail remote offers the exact same commands as ezjail-admin, namely[archive|config|console|create|delete|install|list|restore|start|stop|update]. In addition to that it provides enhanced versions ofcreateanddestroy(the latter a more thorough variant of thedeletecommand.)createcreates a new jail instance on the given host, creates an admin user with sudo privileges and enables ssh access via public key.after setting up the jail it attempts to execute a method namedsetupfromezjailremote.flavours.<name-of-flavour>, passing on all parameters, including any additional, arbitrary keyword arguments.parametersnamename of the new jail,requiredIPthe IP address,requiredadminname of the admin user for the jail, defaults to the current user. the user will be created and added towheel(which in turn will be allowed to sudo without password).keyfilepublic key to install for the admin user, defaults to~/.ssh/identity.pub.flavourthe name of the local flavour, defaults tobasic.ctypedefaults to None and refers to the-cflag, meaning, you can set it tosimple,bde,eliorzfs.destroystops, removes and deletes the given jail instance (but not before asking you one last time, explicitely). however, once you confirm, the jail is irrevocablygone.parametersnamename of the new jail,requiredInstallationSimply use easy_install:easy_install ezjail-remoteDevelopmentTo develop ezjail-remote itself, check out a copy of this repository and then:virtualenv . --no-site-package
./bin/python setup.py developTODOdocument flavour developmentuse a base class for flavourslist them (with their docstr) with ezjail-remote list-flavoursallow chaining/nesting/stacking of flavours (i.e. always include basic)Change history0.2.2 - 2013-05-03Use ezjail version 3.2.2 feature to create ZFS jails by defaultMake use and configuration of sshd in created jail optionalVarious smaller bugfixesofficially out of alpha :)0.2.1 - 2012-09-10add support for creating ZFS (and other image based) jails0.2 - 2012-09-07split installation intobootstrap(which has proven itself useful outside of a ezjail setup) andinstalladded support for ZFScan install ezjail from CVSadded support for flavours outside the ezjail-remote package itself (using namespace packages for ezjailremote.flavours.*)addedstart,stopandjlscommands.0.1 - 2011-07-29Initial release. Provides ‘pass through’ of all commands, as well as enhanced versions forcreateanddestroy.