odoo-ce-inventory
This repository stores hosts informations and related variables for this specific instance of Odoo.
Requirements
-
Clone this repo and odoo-provisioning in the same directory and install the environment requirements
-
Clone odoo-ce in the same directory
-
If you want to test this set up locally, install devenv and do:
cd odoo-ce-inventory devenv # this creates the lxc container and sets its hostname
-
Go to
odoo-provisioning
directory and install its Ansible dependencies:cd ../odoo-provisioning/ ansible-galaxy install -r requirements.yml
-
Execute playbook sys_admins to create users
- development local mode
ansible-playbook playbooks/sys_admins.yml -i ../odoo-ce-inventory/inventory/hosts --limit=dev --user=root
- testing mode
# In testing, add param '-k' to force ansible to ask for the root password # You will need ssh root enabled and package 'sshpass' installed in your machine ansible-playbook playbooks/sys_admins.yml -i ../odoo-ce-inventory/inventory/hosts --limit=testing --user=root -k
-
Run
ansible-playbook
command pointing to theinventory/hosts
file of this repository:- development local mode
# tell it to keep it local with limit=dev # don't ask for vault pass as no secrets are required for local setups ansible-playbook playbooks/provision.yml -i ../odoo-ce-inventory/inventory/hosts --limit=dev
- testing mode
ansible-playbook playbooks/provision.yml -i ../odoo-ce-inventory/inventory/hosts --ask-vault-pass --limit=preprod
- production mode
ansible-playbook playbooks/provision.yml -i ../odoo-ce-inventory/inventory/hosts --ask-vault-pass --limit=prod
-
Start Odoo
- development local mode
# Make sure the lxc container is started sudo lxc-start odoo-ce ssh odoo@odoo-ce.local
Inside the container
cd /opt/odoo pyenv activate odoo ./odoo-bin -c /etc/odoo/odoo.conf -d odoo
-
Now, you can visit:
- In development http://odoo-ce.local:8069
- In testing http://erp-preprod.somcomunitats.coop
- In production http://erp-prod.somcomunitats.coop
Tips
You can skip the NGINX related task by adding --skip-tags "nginx"
to the
ansible-playbook
command.
You can run only the odoo-role task by adding --tag odoo-role
to the ansible-playbook
command.