Ansible Playbook and Plone 5

I've successfully done a Plone 4.3 deployment with the playbook available here: https://github.com/plone/ansible-playbook

I've been digging into it and based on my inspection so far there's no standard way to make it support Plone 5.0 yet.

I was hoping it was as easy as setting a variable like:
plone_version and plone_major_version.

It looks like I will need to create my own roles (like plone.plone_server5 or something). Am I on the right track?

In what way does that not work? I don't think there are any significant changes in buildout structure between Plone 4 and 5 so I'm surprised that that doesn't work.

The playbook appears to call "roles/plone.plone_server/files/zeocluster/" which contains Plone 4.3 specific versions.cfg etc...

If I'm understanding the setup correctly, the Plone 5 deployment is failing because the version pins are for Plone 4.3.

@davisagli,
I see you have a branch that supports providing a custom buildout file:

I'm now discovering the buildout_git_repo setting.
In general it looks like I just need to do more reading:
http://plone-ansible-playbook.readthedocs.org/en/latest/custom_playbook.html#customizing-the-deployment

So far I'ved done the following:
set the following in my local-configure.yml

plone_version =5.0
plone_major_version = 5.0

Customized roles/plone.plone_server/templates/addPloneSite.py.j2

I removed reference to the sunburst and classic theme which don't exist for Plone 5 and therefore broke the installation.

default_extension_profiles = (

'plonetheme.classic:default',

'plonetheme.sunburst:default',

{% if plone_extension_profiles %}

In my
roles/plone.plone_server/files/zeocluster/ folder I did the following:

replace the bootstrap.py with one from here: https://raw.githubusercontent.com/plone/buildout.coredev/5.0/bootstrap.py

I also replaced the versions.cfg with the one from: http://dist.plone.org/release/5.0/versions.cfg

Finally I had to edit roles/plone.plone_server/templates/buildout.cfg.j2 which was pinning setuptools to 7.x so I changed that line to read:

 setuptools =

Now when I run:

ansible-playbook  -i myhost.cfg playbook.yml     

I get the following output:

www.mysite.com        : ok=76   changed=6    unreachable=0    failed=0 

But when I attempt to visit the Plone site I get the following error:

Site Error

An error was encountered while publishing this resource.

Resource not found

Sorry, the requested resource does not exist.

Check the URL and try again.

Resource: Plone GET


Troubleshooting Suggestions

  • The URL may be incorrect.
  • The parameters passed to this resource may be incorrect.
  • A resource that this resource relies on may be encountering an error.

For more detailed information about the error, please refer to the error log.

If the error persists please contact the site maintainer. Thank you for your patience.

So it seems that it is failing on the roles/plone.plone_server/templates/addPloneSite.py.j2 script.

(As usual, reply-by-email did not work. I sent this last night:)

If you look into the github repository for the ansible.plone-server role, you'll see there is a pull request for supporting plone 5. IIRC, it only takes three very minor changes to make it install plone 5.


We'll definitely have a P5 update for the kit by the end of PloneConf2015.

@fulv and @smcmahon ,
Thank you. It worked.
What I did was blow away the default roles/plone.plone_server folder

rm -rf roles/plone.plone_server

Then checked out fulv's branch::

cd roles
git clone -b fulv-plone5 https://github.com/fulv/ansible.plone_server plone.plone_server

Then I was able to use the following command to deploy Plone 5 to my host::

   ansible-playbook  -i myhost.cfg playbook.yml

Glad to hear!

By the way, what I do when I want to try a "source checkout" (in buildout parlance) of ansible.plone_server instead of a released version, is to use a requirements.yml file instead of a requirements.txt, when issuing the initial ansible-galaxy command:

ansible-galaxy -p roles -r requirements.yml install

With the following file:

requirements.yml:

That's because the .yml format allows you to specify URLs instead of just distribution names.
http://docs.ansible.com/ansible/galaxy.html#advanced-control-over-role-requirements-files

plone.plone_server now supports Plone 4.3.x or 5.0. Specify v1.1.3 in your requirements file.

Or, check out the newest ansible-playbook and update your requirements.

Nuff Respect! @smcmahon

I'm seeing the following show up during installation (even though I specified Plone 5.0 as the version).

TASK: [plone.plone_server | Bootstrap buildout for Plone 4.x]  ***************** 

It does in fact install Plone 5.0 though.

Fixed. Though you won't see that until the next release.