Hi friends in Ansible
I have a playbook that sets up a PostgreSQL environment.
One of the tasks sets up a db user.
This task always fails the first time. The error is, that psycopg2 could not be loaded.
If I run the playbook a second time, it works without a glitch.
A clumsy solution I found is to split the playbook into two parts. Running them in sequence work without a problem.
Could anybody of you give me a hint on how to find a solution for this?
thanks
Robert
here is the failing task:
- name: PostgreSQL - Add the config db Odoo user
become: true
become_user: postgres
postgresql_user:
name: ‘{{ odoo_config_db_user }}’
password: ‘{{ odoo_config_db_passwd_crypt }}’
encrypted: yes
role_attr_flags: ‘{{ odoo_postgresql_user_role_attr }}’
ignore_errors: yes