On Wed, 19 Feb 2020 at 15:23, Dick Visser <[email protected]> wrote:
>
> On Wed, 19 Feb 2020 at 15:13, Janmejaya Swain <[email protected]> 
> wrote:
> >
> > Hi ,
> >
> > Can any one please  help on this, which is very appreciable.  .
> >
> > ---
> >  - hosts: all
> >    remote_user: root
> >    vars_files:
> >           - json/UAT.json
> >
> >    tasks:
> >      - name: Generate configGen files
> >        template:
> >          src: /template/test.j2
> >          dest: /properties/test.properties
> >          remote_src: yes
> >          template_host: < host ip >
> >
> >
> > Error:
> >
> > ERROR! vars file /template/test.j2 was not found
> >
> > 15
> >
> > Could not find file on the Ansible Controller.
> >
> > 16
> >
> > If you are using a module and expect the file to exist on the remote, see 
> > the remote_src option
> >
> >
> > In same way it showing it showing json/UAT.json was not found.
> >
> >
> > NOTE: Can you please help on it and we are using ansible 2.9.
>
>
> A few issues:
>
> 1. The file /template/test.j2 needs to be available on the remote
> node, because you specified "remote_src: yes". Fix this.

As [email protected] said the template module does NOT have a
remote_src paramater.
I mixed things up with the file module, which does have that.

A scenario whereby both the template src and destination are on the
remote node is only possible by fetching the template in an
intermediate step.

I remember having tried to combine slurp with copy+remote_src but that
didn't work.


-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwPsYiuuEpxwch1VK0ezsy8pOfuhjkNCZk62xP01-FF_0g%40mail.gmail.com.

Reply via email to