plone / ansible-playbook

An Ansible playbook for automated deployment of full-stack Plone servers.
90 stars 74 forks source link

Vagrant: The sample-multiserver.yml example fails with bionic and "Unable to find any of pip3 to use. pip needs to be installed." #122

Open acsr opened 4 years ago

acsr commented 4 years ago

Full failure report on the prompt for the plone-5.2/primary:

...
TASK [plone.plone_server : Superlance installed] *******************************
fatal: [bionic]: FAILED! => {"changed": false, "msg": "Unable to find any of pip3 to use.  pip needs to be installed."}
...

You can quickly fix that after the initial vagrant up by installing pip3 in the vm like this and reprovision the vm

While the VM is still up after vagrant up:

vagrant ssh  # enter the VM
sudo apt install python3-pip  # install pip by hand (only for testing)

now reprovision:

vagrant provision

To permanently include the pip3 command you need to enhance the playbook. I come back if I fixed it or someone else jumps in to choose the proper location to put the code in.

must be something similar to https://relativkreativ.at/articles/how-to-install-python-with-ansible

For now I have no idea where the pip3 requirement comes from in the current playbook version 1.3.7 since

smcmahon commented 4 years ago

I wonder if the problem here is with the superlance install. I haven't tested using python3 and superlance at the same time.

Can you try your test with "plone_hot_monitor" set to "cron"?

plone_hot_monitor: cron

I like the cron-style hot monitor better in any case. It does a smoother client start/stop.

smcmahon commented 4 years ago

If it turns out that superlance is the problem, I propose to add an error message to let the user know that python3 and superlance aren't compatible.

stevepiercy commented 4 years ago

I ran into this issue myself, and bumping superlance to 1.0 (which supports Python 2 and 3) fixed the reported issue. Or maybe worked around it.

I think it is possible to install Plone 5.2 on Python 3, yes?

https://github.com/plone/ansible.plone_server/blob/95c7b22f15ab5499bc2082a1c298f93539fe1018/defaults/main.yml#L9

stevepiercy commented 4 years ago

I ran into this again, but this time when specifying plone_python_version: '3'. To get past this issue, I used the following in roles/plone.plone_server/tasks/main.yml.

pip: name=superlance version=1.0 extra_args='--index-url=https://pypi.python.org/simple/' executable=/usr/bin/pip3

I got the executable path by looking at set_fact: virtualenv_path=/usr/bin/ in roles/plone.plone_server/tasks/Debian.yml.

After that, I still had to run the playbook repeatedly, once because of the issue mentioned under Supervisor task list is updated and we have a memmon and some other weird issue with Create initial Plone site.

stevepiercy commented 4 years ago

@acsr @smcmahon I submitted https://github.com/plone/ansible.plone_server/pull/137 to resolve this issue.

I still have not got the playbook to run Python 3 yet, but my PR for zc.monitor was approved and merged, and I'm waiting for a new release to see if that works.

stevepiercy commented 4 years ago

Although my PR for zc.monitor was merged and a new release was made...

https://github.com/zopefoundation/zc.monitor/pull/1

...it has a dependency zc.ngi that either needs to be ported to Python 3 or replaced with asyncio:

https://github.com/zopefoundation/zc.monitor/issues/3#issue-534033683