Hi Robert

This doesn't make a whole lot of sense why this would fail and then work. 
Definitely being applied to the SAME host on each run?
I suggest you post your whole playbook(s) here as there's something else 
going on outside the mentioned failing task I suspect.

As a good measure I would also include something like:

- name: Make sure psycopg2 is installed
  pip:
    name: psycopg2
    state: present

before you need it to ensure that base is covered as well.

Phil.


On Tuesday, 21 July 2020 19:51:10 UTC+1, robert rottermann wrote:
>
> 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
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d35e3cf9-af06-4135-b250-5053a8228abfo%40googlegroups.com.

Reply via email to