Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Sadanand Alegaonkar
hello Stefen, I really appreciate your effort to understand my concern. I am specifying mount_points variable in Inventory file and try to keep copy DC-N5K-01 ansible_host=** ansible_ssh= mount_points=["/var/log"] *- name: list file shell: cd "{{item}}"; find *.log

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Stefan Hornburg (Racke)
On 5/25/20 11:36 AM, Sadanand Alegaonkar wrote: > Hello Stefan, > >   Yes log rotation is good option i will this further..  >   > I am working on file deletion use case. In that i am having different mount > points directory, before deletion i need to > take backup of old file and delete > them

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Sadanand Alegaonkar
Hello Stefan, Yes log rotation is good option i will this further.. I am working on file deletion use case. In that i am having different mount points directory, before deletion i need to take backup of old file and delete them . I added mount name in the inventory. Below is the Playbook...

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Stefan Hornburg (Racke)
On 5/25/20 10:42 AM, Sadanand Alegaonkar wrote: > hello Stefan, > > I have to add more task in the playbook, that's why i going with this methods. That is hardly a good reason, especially without further explanation. Regards Racke > > On Mon, 25 May 2020 at 10:46, Stefan Hornburg

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Dick Visser
On Mon, 25 May 2020 at 10:42, Sadanand Alegaonkar wrote: > > hello Stefan, > > I have to add more task in the playbook, that's why i going with this methods. I don't see why you have to? Duplicating logrotate functionality through ansible through shell scripts that need then need to be run

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-25 Thread Sadanand Alegaonkar
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) wrote: > On 5/25/20 4:52 AM, Sadanand Alegaonkar wrote: > > Hello Dick, > > > > Thanks for giving reply, > > Yes corrected this error but the

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-24 Thread Stefan Hornburg (Racke)
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

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-24 Thread Sadanand Alegaonkar
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 On Sun, 24 May 2020 at 22:22, Dick Visser

Re: [ansible-project] unable to generate backup file with registered variable in ansible

2020-05-24 Thread Dick Visser
On Sun, 24 May 2020 at 08:46, Sadanand Alegaonkar < 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