hello Stefan,

I have to add more task in the playbook, that's why i going with this
methods.

On Mon, 25 May 2020 at 10:46, Stefan Hornburg (Racke) <ra...@linuxia.de>
wrote:

> On 5/25/20 4:52 AM, Sadanand Alegaonkar wrote:
> > Hello Dick,
> >
> > Thanks for giving reply,
> > Yes corrected this error but the purpose is not getting fulfilled.
> >
> > I was trying to rename old file in the file system. it is giving below
> error.
> >
> > getting "file.results["stdout"]": "VARIABLE IS NOT DEFINED!" error
>
> Hello Sadanand,
>
> it would be much better to use existing applications on the server itself,
> e.g. logrotate or one
> of the dozens of backup programs for Linux.
>
> Instead of using the shell, I would recommend "find" and "copy" modules.
>
> Regards
>         Racke
>
> >
> > On Sun, 24 May 2020 at 22:22, Dick Visser <dick.vis...@geant.org
> <mailto:dick.vis...@geant.org>> wrote:
> >
> >
> >
> >     On Sun, 24 May 2020 at 08:46, Sadanand Alegaonkar <
> sadanandalegaon...@gmail.com
> >     <mailto:sadanandalegaon...@gmail.com>> wrote:
> >
> >         SUMMARY
> >
> >         I trynig to take backup of existing file. reported below error
> >
> >         ERROR! failed at splitting arguments, either an unbalanced
> jinja2 block or quotes: cp "{{file.stdout}"
> >         "{{file.stdout}}"_bkp
> >
> >
> >
> >     This error is correct, see below
> >
> >
> >         ansible-playbook pb_DBrename_deletefile.yml -i alertdbhost
> >
> >         ISSUE TYPE
> >
> >         [root@XXXXXX database]#
> >
> >         ERROR! failed at splitting arguments, either an unbalanced
> jinja2 block or quotes: cp "{{file.stdout}"
> >         "{{file.stdout}}"_bkp
> >
> >
> >         Ansible Version:
> >
> >         [root@XXXXXX database]# ansible --version
> >         ansible 2.8.5
> >           config file = /etc/ansible/ansible.cfg
> >           configured module search path =
> [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
> >           ansible python module location =
> /usr/lib/python2.7/site-packages/ansible
> >           executable location = /bin/ansible
> >           python version = 2.7.5 (default, Jun 11 2019, 12:19:05) [GCC
> 4.8.5 20150623 (Red Hat 4.8.5-36)]
> >
> >
> >         OS / ENVIRONMENT / INSTALL METHOD
> >
> >         Red Hat Enterprise Linux Server release 7.6 (Maipo)
> >
> >         STEPS TO REPRODUCE
> >         ---
> >          - name: Rename listener Trace file and Delete
> >            hosts: dbhost
> >            gather_facts: no
> >            tasks:
> >              - name: list file
> >                shell: cd "{{item}}"; find *.log
> >                with_items: "{{mount_points}}"
> >                register: file
> >              - debug:
> >                  var: file
> >              - name: Rename file
> >                shell: cp "{{file.stdout}" "
> >
> >
> >     You forgot a curly here
> >
> >
> >         {{file.stdout}}"_bkp
> >               # with_items: "{{file.stdout}}"
> >                register: file1
> >              - debug:
> >                  var: file1
> >
> >
> >         EXPECTED RESULTS
> >         File created with bkp extension
> >
> >         ACTUAL RESULTS
> >         ERROR! failed at splitting arguments, either an unbalanced
> jinja2 block or quotes: cp "{{file.stdout}"
> >         "{{file.stdout}}"_bkp
> >
> >         The error appears to be in
> '/etc/ansible/database/pb_DBrename_deletefile.yml': line 12, column 8, but
> may
> >         be elsewhere in the file depending on the exact syntax problem.
> >
> >         The offending line appears to be:
> >
> >                  var: file
> >              - name: Rename file
> >                ^ here
> >
> >         --
> >         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
> >         ansible-project+unsubscr...@googlegroups.com <mailto:
> ansible-project+unsubscr...@googlegroups.com>.
> >         To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/a27726ee-fe4f-4adc-a58a-8467e633341a%40googlegroups.com
> >         <
> https://groups.google.com/d/msgid/ansible-project/a27726ee-fe4f-4adc-a58a-8467e633341a%40googlegroups.com?utm_medium=email&utm_source=footer
> >.
> >
> >     --
> >     Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
> >
> >     --
> >     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
> >     ansible-project+unsubscr...@googlegroups.com <mailto:
> ansible-project+unsubscr...@googlegroups.com>.
> >     To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwOaJOfb1Ai3uOXKQP2iUP_5gFCeoWk4iayJbiwL6fZRjw%40mail.gmail.com
> >     <
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwOaJOfb1Ai3uOXKQP2iUP_5gFCeoWk4iayJbiwL6fZRjw%40mail.gmail.com?utm_medium=email&utm_source=footer
> >.
> >
> >
> >
> > --
> > Thanks and Regards
> >  Sadanand V.Alegaonkar
> > Cell No:9975632660
> >
> > --
> > 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
> > ansible-project+unsubscr...@googlegroups.com <mailto:
> ansible-project+unsubscr...@googlegroups.com>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/CA%2Bo9MBTXKZM14f253-nnRa96um6hvuVdTBEyBF8Ye9KZ-wgwug%40mail.gmail.com
> > <
> https://groups.google.com/d/msgid/ansible-project/CA%2Bo9MBTXKZM14f253-nnRa96um6hvuVdTBEyBF8Ye9KZ-wgwug%40mail.gmail.com?utm_medium=email&utm_source=footer
> >.
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/28eaae98-fe4a-834c-565d-32c91e059da6%40linuxia.de
> .
>


-- 
Thanks and Regards
 Sadanand V.Alegaonkar
Cell No:9975632660

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CA%2Bo9MBRRNSoUN3SQfr_JOrKpNwZY_vc0GyuWa2eB1%3D-6ZxZWhQ%40mail.gmail.com.

Reply via email to