Plone’s Ansible Playbook can completely provision a remote server to run a full-stack, production-ready Plone server, including:
- Plone in a cluster configuration;
- Automatic starting and process control of the Plone cluster with supervisor;
- Load balancing of the cluster with HAProxy;
- Caching with Varnish;
- Nginx as a world-facing reverse proxy and URL rewrite engine;
- An outgoing-mail-only mail server using Postfix;
- Monitoring and log analysis with munin-node, logwatch and fail2ban.
- Use of a local VirtualBox provisioned via Vagrant to test and model your remote server.
An Ansible playbook and roles describe the desired condition of the server. The playbook is used both for initial provisioning and for updating.
- Install a current version of Ansible;
- If you wish to test locally, install Vagrant and VirtualBox;
- Check out or download a copy of this package;
ansible-galaxy -p roles -r requirements.yml installto install required roles;
- Copy one of the
local-configure.ymland edit as needed.
- To test in a local virtual machine, run
- To deploy, create an Ansible inventory file for the remote host (look at vbox_host.cfg for an example) and run
ansible-playbook --ask-sudo-pass -i myhost.cfg playbook.yml;
- Set a real password for your Plone instance on the target server;
- Set up appropriate firewalls.
The goal of an automated-server provisioning system like Ansible is a completely reproducible server configuration. If you wish to achieve this goal, discipline yourself to never changing configuration on your target machines via login.
That doesn’t mean you never log in to your provisioned server. It just means that when you do, you resist changing configuration options directly. Instead, change your playbook, test your changes against a test server, then use your playbook to update the target server.
We chose Ansible for our provisioning tool because:
- It requires no client component on the remote machine. Everything is done via ssh.
- It’s YAML configuration files use structure and syntax that will be familiar to Python programmers. YAML basically represents a Python data structure in an outline. Conditional and loop expressions are in Python. Templating via Jinja2 is simple and clean.
- Ansible’s documentation is excellent and complete.
- Ansible is easily extended by roles. Many basic roles are available on Ansible Galaxy.
If you need to log in¶
You should not need to. But if you do, you should know:
- The Plone zeoserver and zeoclient processes should be run under the plone_daemon login; they will normally be controlled via supervisor;
- Run buildout as plone_buildout.