Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Provide sample postgrace sql select script using ansible playbook?

I tried to connect and execute the Postgrace sql script using belo code but not working as expected.Please provide me any samples u have/correct me if anything wrong I am doing.

- name: Connect to postgres

 shell: |
      export PGPASSWORD ="{{ pgpass_filepath }}" && \.~admin/.profile>/dev/null\
      /opt/rh/rh-postgresql95/root/usr/bin/psql\
      -p 888 \
      -d test \
      -U test1 \
      -h test2 \
      -f "select * from employee;" 2>&1

Comments