ansible-odoo icon indicating copy to clipboard operation
ansible-odoo copied to clipboard

nginx role to configure odoo

Open JordiBForgeFlow opened this issue 7 years ago • 11 comments

Hi! Would be interesting to define also a role that can be nicely integrated with this.

I have seen this: https://github.com/ridingbytes/ridingbytes.ansible-odoo-playbook/blob/master/roles/ridingbytes_nginx/vars/main.yml

I will be looking into it more.

JordiBForgeFlow avatar Feb 03 '18 02:02 JordiBForgeFlow

I agree. We use internally some roles based on apache (never learned nginx...), so feel free to contribute to a nginx one.

sebalix avatar Feb 05 '18 09:02 sebalix

I think apache can also be good!

JordiBForgeFlow avatar Feb 06 '18 13:02 JordiBForgeFlow

Another example using nginx: https://github.com/waltervargas/ansible-odoo/tree/master/roles/nginx

An interesting feature is also the possibility to install certificates using certbot (https://certbot.eff.org/) https://github.com/geerlingguy/ansible-role-certbot

cc @hveficent

JordiBForgeFlow avatar Feb 07 '18 17:02 JordiBForgeFlow

What about an option in defaults/main.yml to choose between apache and nginx ? I think I can handle that.

mmequignon avatar Feb 17 '18 00:02 mmequignon

@mmequignon We have just implemented the role for nginx here: https://github.com/Eficent/ansible-odoo-nginx

I think that a role ansible-odoo-apache would be good.

Then it would be up to the user to choose.

But again, another option would be to integrate both options to the ansible-odoo role.

JordiBForgeFlow avatar Feb 17 '18 00:02 JordiBForgeFlow

We have also used https://github.com/geerlingguy/ansible-role-certbot and it is amazing how well it manages the install of a trusted ssl certificate for a domain using letsencrypt.

JordiBForgeFlow avatar Feb 17 '18 00:02 JordiBForgeFlow

My point of view on this: this role should only focus on installing Odoo, the reverse proxy is another subject which should be processed by another dedicated role (as @jbeficent already did with ansible-odoo-nginx, and as we already did too with Apache). A reverse proxy can also be installed on a different machine that the one which run Odoo. The same applies for PostgreSQL.

Now, either we create another repo to host dedicated roles, or we put several roles inside this Git repository. Don't know how Ansible Galaxy can handle that last option (nb: we need an OCA account for that too).

sebalix avatar Feb 17 '18 10:02 sebalix

I agree with @sebalix. We can propose my ansible-odoo-nginx to OCA as well, and push to ansible galaxy.

JordiBForgeFlow avatar Feb 17 '18 11:02 JordiBForgeFlow

@sebalix I think that creating a repo with a selection of roles seems more interesting. For instance, after a git clone, a user should just have to pick roles that he wants to run in its playbook. Include roles in another role seems to require more work.

mmequignon avatar Feb 17 '18 13:02 mmequignon

Not sure how adding multiplebroles in the same repo would then play in ansible galaxy.

Ansible Galaxy is the main marketing channel for the roles. I would adhere to whatever format it requires to attract more users and contributors.

On Feb 17, 2018 2:00 PM, "Matthieu Méquignon" [email protected] wrote:

@sebalix https://github.com/sebalix I think that creating a repo with a selection of roles seems more interesting. For instance, after a git clone, a user should just have to pick roles that he wants to run in its playbook. Include roles in another role seems to require more work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/OCA/ansible-odoo/issues/67#issuecomment-366439999, or mute the thread https://github.com/notifications/unsubscribe-auth/AHU_Vnt0Pir_UfDcfp61OVayZ05kQlAdks5tVs1XgaJpZM4R4At_ .

JordiBForgeFlow avatar Feb 17 '18 14:02 JordiBForgeFlow

Well, the reason why I proposed that structure is that it's actually the common structure for odoo modules OCA/<theme>/<module>. So, regarding the fact that ansible galaxy requires a dedicated repo per role, wouldn't it that cleaner to create a dedicated OCA user for ansible roles, as @sebalix suggested in it's previous message ?

mmequignon avatar Feb 17 '18 15:02 mmequignon