main.yml 908 B

123456789101112131415161718192021222324252627282930
  1. ---
  2. # This playbook prepare a new system directories
  3. - name: Create directories structure
  4. file:
  5. path: "{{ odoo_root_path }}/{{ odoo_system_name }}/{{ item }}"
  6. state: directory
  7. mode: 0777
  8. with_items: "{{ odoo_default_paths }}"
  9. become: true
  10. - name: Create file configuration
  11. template:
  12. src: openerp-server.j2
  13. dest: "{{ odoo_root_path }}/{{ odoo_system_name }}/config/openerp-server.conf"
  14. backup: yes
  15. - name: Create container
  16. docker_container:
  17. name: "{{ odoo_system_name }}"
  18. image: "odoo/eiru:1.0"
  19. exposed_ports:
  20. - "{{ odoo_system_port }}:8069"
  21. links:
  22. - "{{ postgres_container_name }}:db"
  23. volumes:
  24. - "{{ odoo_root_path }}/{{ odoo_system_name }}/config:/etc/odoo"
  25. - "{{ odoo_root_path }}/{{ odoo_system_name }}/custom-addons:/mnt/extra-addons"
  26. - "{{ odoo_root_path }}/{{ odoo_system_name }}/files:/var/lib/odoo"
  27. become: true