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
Post a Comment