diff --git a/tasks/config.yml b/tasks/config.yml index 95b2e86..482a135 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -1,8 +1,20 @@ --- +- name: Grep admin_passwd (to preserve) from current Odoo configuration file + shell: grep admin_passwd {{ odoo_config_file }} + register: grep_admin_passwd + failed_when: false + changed_when: false + - name: Generate Odoo configuration file template: src=odoo-{{ odoo_version }}.conf dest={{ odoo_config_file }} owner={{ odoo_user }} group={{ odoo_user }} mode=0600 force={{ odoo_force_config and 'yes' or 'no' }} backup=yes + +- name: Preserve/replace previous admin_passwd in Odoo configuration file + lineinfile: + path: "{{ odoo_config_file }}" + regexp: '^admin_passwd.*=' + line: "{{ grep_admin_passwd.stdout }}" notify: Restart Odoo