From c96fe5470f1dddd01fb5468140f95f76c99133ef Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Wed, 4 Jul 2018 23:26:40 +0200 Subject: [PATCH 1/6] force the creation of odoo_workdir and odoo_rootdir --- tasks/install.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/install.yml b/tasks/install.yml index fcca158..6e7b4e0 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -62,6 +62,14 @@ tags: - odoo_project +- name: Create working dir directory + file: path={{ odoo_workdir }} state=directory + owner={{ odoo_user }} group={{ odoo_user }} force=yes + +- name: Create odoo server directory + file: path={{ odoo_rootdir }} state=directory + owner={{ odoo_user }} group={{ odoo_user }} force=yes + - name: Create odoo data dir directory file: path={{ odoo_config_data_dir }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes From 0c6f02a4b8dcb3e0c70012c339405995c21d28af Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Thu, 5 Jul 2018 00:06:20 +0200 Subject: [PATCH 2/6] fixup! --- defaults/main.yml | 3 ++- tasks/install.yml | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index c270c5c..b8df6d1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -39,7 +39,8 @@ odoo_postgresql_extensions: - unaccent # Standard installation/configuration options (odoo_install_type == 'standard') -odoo_config_file: "/home/{{ odoo_user }}/{{ odoo_service }}.conf" +odoo_config_file_dir: "/home/{{ odoo_user }}" +odoo_config_file: "{{ odoo_config_file_dir }}/{{ odoo_service }}.conf" odoo_force_config: True odoo_config_addons_path: - "/home/{{ odoo_user }}/odoo/server/{{ (odoo_version | int) < 10 and 'openerp' or 'odoo' }}/addons" diff --git a/tasks/install.yml b/tasks/install.yml index 6e7b4e0..7287b5c 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -69,6 +69,14 @@ - name: Create odoo server directory file: path={{ odoo_rootdir }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes + when: odoo_install_type != 'pip' + tags: + - odoo_install_type_standard + - odoo_install_type_buildout + +- name: Create odoo config file directory + file: path={{ odoo_config_file_dir }} state=directory + owner={{ odoo_user }} group={{ odoo_user }} force=yes - name: Create odoo data dir directory file: path={{ odoo_config_data_dir }} state=directory From 4a4e683c34c9ca8c0ee0b9b2080a5456fb9febaa Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Thu, 5 Jul 2018 15:03:06 +0200 Subject: [PATCH 3/6] renames --- defaults/main.yml | 6 +++--- tasks/install.yml | 14 +++++++++----- templates/odoo-10.0.init | 2 +- templates/odoo-8.0.init | 2 +- templates/odoo-9.0.init | 2 +- templates/odoo-standard.service | 4 ++-- vars/Ubuntu-16_Odoo-11.yml | 2 +- 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b8df6d1..cd3c033 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,10 +12,10 @@ odoo_init: True odoo_init_env: {} #VAR1: value1 #VAR2: value2 -odoo_logdir: "/var/log/{{ odoo_user }}" +odoo_logdir: "/var/log" odoo_logfile: "{{ ansible_service_mgr != 'systemd' and ('/'.join([odoo_logdir, odoo_service]) + '.log') or ''}}" -odoo_workdir: "/home/{{ odoo_user }}/odoo" -odoo_rootdir: "{{ odoo_install_type == 'buildout' and '/home/'+odoo_user+'/odoo/parts/odoo' or '/home/'+odoo_user+'/odoo/server' }}" +odoo_workdir: "/home/{{ odoo_user }}/{{ odoo_service }}" +odoo_rootdir: "{{ '/home/'+odoo_user+'/'+odoo_service }}" # Project repository to deploy odoo_repo_type: git # git or hg diff --git a/tasks/install.yml b/tasks/install.yml index 7287b5c..899f29f 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -25,7 +25,7 @@ - odoo_install_ssh - name: Create log directory - file: path={{ odoo_logdir }} state=directory + file: path={{ odoo_logdir }}/{{ odoo_service }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=no tags: - odoo_log @@ -63,11 +63,11 @@ - odoo_project - name: Create working dir directory - file: path={{ odoo_workdir }} state=directory + file: path={{ odoo_workdir }}/{{ odoo_service }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes - name: Create odoo server directory - file: path={{ odoo_rootdir }} state=directory + file: path={{ odoo_rootdir }}/{{ odoo_service }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes when: odoo_install_type != 'pip' tags: @@ -75,11 +75,15 @@ - odoo_install_type_buildout - name: Create odoo config file directory - file: path={{ odoo_config_file_dir }} state=directory + file: path={{ odoo_config_file_dir }}/{{ odoo_service }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes + when: odoo_install_type != 'buildout' + tags: + - odoo_install_type_pip + - odoo_install_type_standard - name: Create odoo data dir directory - file: path={{ odoo_config_data_dir }} state=directory + file: path={{ odoo_config_data_dir }}/{{ odoo_service }} state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes when: odoo_install_type != 'buildout' tags: diff --git a/templates/odoo-10.0.init b/templates/odoo-10.0.init index 1b9a7a7..140bf81 100644 --- a/templates/odoo-10.0.init +++ b/templates/odoo-10.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/odoo-bin +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo-bin NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-8.0.init b/templates/odoo-8.0.init index 322e1a8..acb2766 100644 --- a/templates/odoo-8.0.init +++ b/templates/odoo-8.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/odoo.py +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-9.0.init b/templates/odoo-9.0.init index 322e1a8..acb2766 100644 --- a/templates/odoo-9.0.init +++ b/templates/odoo-9.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/odoo.py +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-standard.service b/templates/odoo-standard.service index e4ad3e7..fa69c85 100644 --- a/templates/odoo-standard.service +++ b/templates/odoo-standard.service @@ -7,10 +7,10 @@ Type=simple User={{ odoo_user }} WorkingDirectory={{ odoo_workdir }} {% if odoo_version | version_compare('10.0', '>=') %} -ExecStart={{ odoo_rootdir }}/odoo-bin{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} +ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/odoo-bin{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} KillMode=mixed {% else %} -ExecStart={{ odoo_rootdir }}/odoo.py{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} +ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} {% endif %} {% for name, value in odoo_init_env.iteritems() %} Environment={{ name }}={{ value }} diff --git a/vars/Ubuntu-16_Odoo-11.yml b/vars/Ubuntu-16_Odoo-11.yml index 890ceec..5a73a61 100644 --- a/vars/Ubuntu-16_Odoo-11.yml +++ b/vars/Ubuntu-16_Odoo-11.yml @@ -96,7 +96,7 @@ odoo_buildout_build_dependencies: - libwebp-dev odoo_buildout_venv_cmd: "virtualenv --no-setuptools --python=python3 {{ odoo_buildout_venv_path }}" -odoo_pip_venv_cmd: "virtualenv --python=python3 {{ odoo_pip_venv_path }}" +ยบ: "virtualenv --python=python3 {{ odoo_pip_venv_path }}" odoo_wkhtmltox_version: 0.12.4 From af4ef6df462f77e8875ff7eb8884293f322459b7 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Thu, 5 Jul 2018 15:08:46 +0200 Subject: [PATCH 4/6] fixup! --- tasks/install.yml | 2 +- templates/odoo-10.0.init | 2 +- templates/odoo-8.0.init | 2 +- templates/odoo-9.0.init | 2 +- templates/odoo-standard.service | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/install.yml b/tasks/install.yml index 899f29f..d6567c6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -67,7 +67,7 @@ owner={{ odoo_user }} group={{ odoo_user }} force=yes - name: Create odoo server directory - file: path={{ odoo_rootdir }}/{{ odoo_service }} state=directory + file: path={{ odoo_rootdir }}/{{ odoo_service }}/server state=directory owner={{ odoo_user }} group={{ odoo_user }} force=yes when: odoo_install_type != 'pip' tags: diff --git a/templates/odoo-10.0.init b/templates/odoo-10.0.init index 140bf81..e39c6a1 100644 --- a/templates/odoo-10.0.init +++ b/templates/odoo-10.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo-bin +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/server/odoo-bin NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-8.0.init b/templates/odoo-8.0.init index acb2766..32f738a 100644 --- a/templates/odoo-8.0.init +++ b/templates/odoo-8.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/server/odoo.py NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-9.0.init b/templates/odoo-9.0.init index acb2766..32f738a 100644 --- a/templates/odoo-9.0.init +++ b/templates/odoo-9.0.init @@ -16,7 +16,7 @@ PATH=/usr/local/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin WORKDIR={{ odoo_workdir }} -DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py +DAEMON={{ odoo_rootdir }}/{{ odoo_service }}/server/odoo.py NAME={{ odoo_service }} DESC={{ odoo_service }} CONFIG={{ odoo_config_file }} diff --git a/templates/odoo-standard.service b/templates/odoo-standard.service index fa69c85..3f4f819 100644 --- a/templates/odoo-standard.service +++ b/templates/odoo-standard.service @@ -7,10 +7,10 @@ Type=simple User={{ odoo_user }} WorkingDirectory={{ odoo_workdir }} {% if odoo_version | version_compare('10.0', '>=') %} -ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/odoo-bin{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} +ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/server/odoo-bin{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} KillMode=mixed {% else %} -ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/odoo.py{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} +ExecStart={{ odoo_rootdir }}/{{ odoo_service }}/server/odoo.py{{ odoo_logfile and ' --logfile %s' % odoo_logfile }} --config {{ odoo_config_file }} {% endif %} {% for name, value in odoo_init_env.iteritems() %} Environment={{ name }}={{ value }} From 2f7be352e444d4122f3559366e56c5a42b9fcce9 Mon Sep 17 00:00:00 2001 From: Jordi Ballester Alomar Date: Thu, 5 Jul 2018 15:21:30 +0200 Subject: [PATCH 5/6] fixup! --- .idea/workspace.xml | 314 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..2a89180 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,314 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + odoo_config_syslog + odoo_config_logfile + log + odoo_logdir + not in + requirements + virtualenv + odoo_config_file + odoo + odoo_service + odoo_rootdir + + + $PROJECT_DIR$ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - 1529570838166 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/defaults/main.yml b/defaults/main.yml index cd3c033..f8663de 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -107,13 +107,13 @@ odoo_config_custom: {} #your_option2: value2 # Pip installation options (odoo_install_type == 'pip') -odoo_pip_venv_path: "{{ odoo_workdir }}/sandbox" +odoo_pip_venv_path: "{{ odoo_workdir }}/{{ odoo_service }}/sandbox" odoo_pip_requirements_url: "file:///home/{{ odoo_user }}/requirements.txt" odoo_pip_odoo_bin_path: "{{ odoo_pip_venv_path }}/bin/{{ (odoo_version | int) < 10 and 'odoo.py' or 'odoo' }}" # Buildout installation options (odoo_install_type == 'buildout') odoo_buildout_version: 2.10.0 -odoo_buildout_venv_path: "{{ odoo_workdir }}/sandbox" +odoo_buildout_venv_path: "{{ odoo_workdir }}/{{ odoo_service }}/sandbox" odoo_buildout_bootstrap_path: "{{ odoo_workdir }}/bootstrap.py" odoo_buildout_bootstrap_cmd: "{{ odoo_buildout_venv_path }}/bin/python {{ odoo_buildout_bootstrap_path }} -c {{ odoo_buildout_config_path }} --buildout-version {{ odoo_buildout_version }}" odoo_buildout_bin_path: "{{ odoo_workdir }}/bin/buildout"