Subject: Re: [ansible-devel] ansible task to cat a file with sql commands and pipe the commands into database using psql with synchronise module (remotely)

What happens if you use shell instead of command?

I'm not 100% certain but I think what's happening is that since you're
using the ansible command module instead of the shell module, it is
running the equivalent of:
  cat '/var/lib/pgsql/temp/truncate_sql'
'/var/lib/pgsql/temp/postcodesio-*' '|' 'psql' 'postcodesiodb'

That's sending the entire output of the first couple files to stdout
which the command module is then buffering to send back to the
controller.

If you use the shell module then the pipe will actually be interpreted
by the shell and so it will do what you want.  (If I'm wrong about why
the MemoryError is happening, there might be another problem in
addition but I am hopeful that it's all tied together).

-Toshio

On Tue, Nov 26, 2019 at 9:12 AM jonin <[EMAIL PROTECTED]> wrote:

--
  jonin 2019-11-26, 17:12
  jonin 2019-11-27, 11:08