Plugin for ploy to provision FreeBSD jails using ezjail.
Project description
Overview
The ploy_ezjail plugin provides integration of ezjail with ploy to manage FreeBSD jails.
Installation
ploy_ezjail is best installed with easy_install, pip or with zc.recipe.egg in a buildout.
Masters
To use ploy_ezjail you need a host running FreeBSD on which you want to manage jails.
You declare a master with [ez-master:masterid] where masterid is the name you want to use for this master. Now you can either add options like for a plain ploy instance, or you can use the instance option to refer to another instance from your config like this:
[ez-master:master1] host = myhost.example.com [plain-instance:foohost] host = foohost.example.com [ez-master:master2] instance = foohost
The latter is most useful in conjunction with other ploy backend plugins, as it allows you to easily switch between provisioners, i.e. to have an ez-master provisioned on VirtualBox during development and on a plain instance in production.
Options
- debug-commands
If set to yes, the commands executed on the host are echoed locally.
- instance
The instance to use as host for this master. If empty, the local machine is used without an ssh connection.
- ezjail-admin
Path to the ezjail-admin script on the host. Defaults to /usr/local/bin/ezjail-admin.
- sudo
Use sudo to run commands on the host.
Instances
At the moment all jails will be created using ZFS (the -c zfs option of ezjail-admin), so the host needs to be setup accordingly.
Options
- ip
The ip address to use for the jail.
This can either be a single IPv4 address:
ip = 10.0.0.3
or any number of IPv4 and IPv6 addresses attached to different devices:
ip = lo1|10.0.0.3,vtnet0|2a03:b0c0:3:d0::3a4d:c002
The latter format is ezjail’s own. Required
- flavour
The flavour to use for this jail. This is explained in the ezjail docs.
- ezjail-name
The name to use for the jail. By default the id of the instance is used.
- mounts
Additional mount points for the jail. You can specify one mount point per line. The format is:
src=SRC dst=DST [ro=true] [create=true]
The src is the path on the host, dst is the path inside the jail.
If ro is set to true, then the mount is read only.
When create is enabled, then the src path is created with mkdir -p. The dst path is always created inside the jail with mkdir -p.
You can reference ZFS sections inside src with {zfs[name]} where name is the ez-zfs section name. You can use the name of the jail instance with {name}} in both src and dst. Examples:
src=/foo dst=/foo src={zfs[backup]} dst=/bak src={zfs[data]}/{name} dst=/mnt/data create=true src={zfs[static]} dst=/mnt/static ro=true
- no-terminate
If set to yes, the jail can’t be terminated via ploy until the setting is changed to no or removed entirely.
- startup_script
Path to a local script (relative to the location of the configuration file) which will be run inside the jail right after creation and first start of the jail.
- rc_require
String that indicates which other jails this jail requires to start up, effectively allowing you to define the startup order of jails. See rcorder(8) for more details. This value is written upon each startup of the jail not just when it is created initially, so to have changes take effect, it’s sufficient to restart it. Optional
- rc_provide
String that indicates what this jail provides. ezjail itself always sets its jails to provide standard_ezjail to which ploy_ezjail adds the name of the jail. IOW if you simply want to build a startup order using the names of the jails, you will not need to set this value. If you want this jail to provide any additional values, set them here. This value is written upon each startup of the jail not just when it is created initially, so to have changes take effect, it’s sufficient to restart it. Optional
ZFS sections
You can specify ZFS filesystems via [ez-zfs:name] sections. This is used in mounts of jails to get the mountpoint and verify that the path exists and is it’s own ZFS filesystem. You can also create new ZFS filesystems with the create option.
Options
- create
If set to yes, the filesystem is created when first used.
- path
Specifies the path of this filesystem. This is not the mountpoint, but the ZFS path. You can reference other ZFS sections with {zfs[name][path]}. The name is the name of the referenced ZFS section. The [path] at the end is mandatory, as otherwise you would get the mountpoint of the referenced ZFS section. Examples:
[ez-zfs:data] path = tank/data [ez-zfs:shared] path = {zfs[data][path]}/shared [ez-zfs:jails] path = {zfs[data][path]}/jails [ez-zfs:backup] create = true path = tank/backup
Changelog
1.5.0 - 2017-12-17
Add get_fingerprints to support host keys with all key types. [fschulze]
Fix jail host status command for various cases. [fschulze]
Output stdout in addition to stderr on various errors. This let’s one see additional debug info when jails don’t start. [fschulze]
1.4.0 - 2015-10-16
Allow setting the jail name via ezjail-name instead of using the instance id as the default. [fschulze]
1.3.0 - 2015-09-03
Improved error handling with useful error messages instead of tracebacks. [fschulze]
Allow setting startup order of jails. [tomster]
1.2.0 - 2015-03-05
Use new Executor helper from ploy 1.2.0 which handles ssh agent forwarding. [fschulze]
Enable “local mode” where if the instance option is empty all commands are executed locally. [fschulze]
1.1.0 - 2014-10-27
Print status of all jails when requesting status of master. [fschulze]
Check jail status before trying to connect. [fschulze]
Use new helper in ploy 1.0.2 to setup proxycommand. [fschulze]
1.0.0 - 2014-07-19
Added documentation. [fschulze]
1.0b9 - 2014-07-08
Packaging and test fixes. [fschulze]
1.0b8 - 2014-07-04
Python 3 compatibility. [fschulze]
Renamed mr.awsome to ploy and mr.awsome.ezjail to ploy_ezjail. [fschulze]
1.0b7 - 2014-06-16
Provide default values for proxyhost and proxycommand options. [fschulze]
Merge config of ez-master with the instance it’s using. [fschulze]
1.0b6 - 2014-06-11
Pass changes of proxy instance config on to the proxied instance config. [fschulze]
1.0b5 - 2014-06-10
Forcefully destroy jail. Together with ezjail 3.4.1 this solves the issue that sometimes the ZFS filesystem wasn’t removed and the jail couldn’t be started without manual intervention. [fschulze]
1.0b4 - 2014-05-22
Clear out massagers after copying the config for the proxy instance to prevent conflicts when the proxy instance is created. [fschulze]
1.0b3 - 2014-05-21
Fixes to make [instance:...] using an ez-master work. [fschulze]
1.0b2 - 2014-05-15
Added instance option to ez-master section to use another instance as the jail host. [fschulze, tomster]
Moved setuptools-git from setup.py to .travis.yml, it’s only needed for releases and testing. [fschulze]
1.0b1 - 2014-03-24
Initial release [fschulze]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ploy_ezjail-1.5.0.tar.gz
.
File metadata
- Download URL: ploy_ezjail-1.5.0.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8a3e30ba4f13156a8d417ffeafe7b2e9e4663bc195f10c922a0ad1d79a20a40 |
|
MD5 | 650dc16a83f46a1eb6400958c5b45de2 |
|
BLAKE2b-256 | 0e9eac32a20239afefbfc44a66ab46d1265739afd2cdc88e655416bb7cbc4719 |
File details
Details for the file ploy_ezjail-1.5.0-py2-none-any.whl
.
File metadata
- Download URL: ploy_ezjail-1.5.0-py2-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79f8dbc7c3f5c90c2358f63e2f6a1c998007f27882b1dda6b8a30b2e2f441274 |
|
MD5 | c94e73412a644a9275128ca0b6d25350 |
|
BLAKE2b-256 | 3927fbe214b4ca376d442cda1bdafbab79ab79637575baa228984417ebc71e7b |