plone / demo.plone.org

https://demo.plone.org
MIT License
4 stars 1 forks source link

Add Ansible playbooks #1

Closed sneridagh closed 1 year ago

sneridagh commented 3 years ago

Is this deployment supposed to be on a local development environment or on a third party provider (such as Digital Ocean), both, or other? We should be explicit about any prerequisites and the environments where this playbook may be used.

This is for production deployment only. I hope this fills some gaps for people who never deployed Volto (or any Node app). For local development, there are other methods (documented in the docs) and now depending on what you want to accomplish. The installers team is also working into them but it's true that documentation should be improved.

stevepiercy commented 3 years ago

The documentation about the process to get this running does not exist. I tried to push a commit to this branch with my notes to add to the README.md, but I cannot push to this repo. I've pasted my notes below.

I assume that the process described in https://github.com/plone/ansible-playbook#plone-ansible-playbook applies for this playbook. If not please correct me.


Ansible Usage

Checkout and work with this repository.

git clone https://github.com/plone/6.demo.plone.org.git
cd 6.demo.plone.org.git
# git checkout ansible # for testing this branch only

Create a Python virtual environment, upgrade its package management tools, and install Ansible into it.

python3 -m venv env
env/bin/pip install --upgrade pip setuptools
env/bin/pip install ansible

Create or reuse an existing SSH key to deploy into a virtual machine in the next step.

ssh-keygen

Create a remote virtual machine for production deployment, such as a Digital Ocean droplet or AWS EC2 instance.

This playbook has been tested on Ubuntu 20.04 LTS only. The minimum requirements for the virtual machine include ___GB memory. Obtain the hostname of your virtual machine. This process is left to the provider to document.

Update the Ansible configuration file at ansible/vbox_host.cfg with your hostname, replacing the value of <name_of_your_host>.

Run the playbook.

env/bin/ansible-playbook -i ansible/vbox_host.cfg ansible/volto-demo.yml

PLAY [all] *************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************
fatal: [143.198.238.54]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 127.0.0.1 port 2222: Connection refused", "unreachable": true}

PLAY RECAP *************************************************************************************************************
143.198.238.54             : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

sad trombone

sneridagh commented 3 years ago

@stevepiercy I just gave you access, sorry, I forgot to add proper permissions on creation, please feel free to push whatever you want to it. I would greatly appreciate it! Sorry if this contribution does not have a sense of completeness but I thought it's better to have it (although un-explained in a narrative way) than not having nothing.

I'm fighting in a lot of fronts nowadays, I'll try to get back to it. I'm preparing some things for the WPD, related to this.

stevepiercy commented 3 years ago

@sneridagh thank you for access!

I pushed my commit to this branch. Most of it is my best guess. I was not able to deploy successfully. If you can fill in any missing pieces, I would appreciate it.

https://github.com/plone/6.demo.plone.org/pull/1/commits/ec665a628827ee505333a113b4c1430bc9bcc7f2

sneridagh commented 1 year ago

Merging for convenience, since we have to rethink the whole deployment for the demo and use current deployment best practices.