When I issue the psql
command like this in my playbook:
- name: Run psql to pull in initial config data
become_method: sudo
become: yes
become_user: postgres
command: psql -U postgres -w eclaim < /opt/eclaim_revamp/sql_scripts/initial_config.sql
It takes forever to complete, looks as though hang, but when I use shell
, it can get through:
- name: Run psql to pull in initial data
become_method: sudo
become: yes
become_user: postgres
shell: psql -U postgres -w eclaim < /opt/eclaim_revamp/sql_scripts/initial_sql_script.sql
Can anybody tell me why ?