Hub Playbooks¶
Jailrun uses Ansible for all provisioning — every jail setup is a playbook you can read, modify, and version. But not every playbook needs to be written from scratch.
Jailrun Hub¶
Jailrun Hub is a curated collection of ready-to-use playbooks for common services — PostgreSQL, Redis, Nginx, Imagor, and more. Point a setup step at a Hub playbook using the hub:// shorthand:
jail "hypha-nginx" {
setup {
nginx {
type = "ansible";
url = "hub://nginx/rolling";
vars { NGINX_LISTEN_PORT = "88"; }
}
}
forward {
http { host = 8888; jail = 88; }
}
}
This is equivalent to a full URL:
Pinning versions¶
Pin to a tag for reproducible builds:
Passing variables¶
Pass extra variables into the playbook with vars — each Hub playbook documents what it accepts. Works the same way with local playbooks:
Composing playbooks¶
Setup isn't limited to a single playbook. You can stack them — mixing Hub playbooks with your own, composing layer by layer:
setup {
nginx {
type = "ansible";
url = "hub://nginx/rolling";
vars { NGINX_LISTEN_PORT = "80"; }
}
app {
type = "ansible";
file = "playbooks/deploy-app.yml";
}
}
Playbooks run in the order they're defined.