Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] Preserve/replace previous admin_passwd in Odoo configuration file #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions tasks/config.yml
Original file line number Diff line number Diff line change
@@ -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