update users set crypted_password = '$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi', salt=null, hash_method='BCRYPT' where login = 'admin'
- name: Reset Admin pw become: yes become_user: postgres command: psql -c "update users set crypted_password = '{{ admin_password | password_hash('bcrypt') }}' where login = 'admin'" sonarqube tags: query
- name: Reset Admin pw
become: yes
become_user: postgres
command: psql -c "update users set crypted_password = '{{ admin_password | password_hash('bcrypt', salt=None) }}' where login = 'admin'" sonarqube
tags: query
You manual command has more arguments than the one in your task.
Try making that consistent.
If that doesn't work, try hardcoding the hash in your task to see if
that works at all.
On Tue, 10 Mar 2020 at 13:21, Bala Mutyam <koti.r...@gmail.com> wrote:
>
> Hi Everyone,
>
> I'm trying to create a task for below command but it's not working, can you help me how to make it work please?
>
> Command:
>
> update users set crypted_password = '$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi', salt=null, hash_method='BCRYPT' where login = 'admin'
>
> - name: Reset Admin pw
> become: yes
> become_user: postgres
> command: psql -c "update users set crypted_password = '{{ admin_password | password_hash('bcrypt') }}' where login = 'admin'" sonarqube
> tags: query
>
>
> I'm successfully running the task but not able to login with the admin_password.
>
> --
> 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 ansible...@googlegroups.com.
- name: Reset Admin pw become: yes become_user: postgres command: command: psql -c "update users set crypted_password = '{{ admin_password | password_hash('bcrypt', salt=None) }}' where login = 'admin'" sonarqube tags: query
update users set crypted_password = '$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi', salt=null, hash_method='BCRYPT' where login = 'admin'