Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-23 Thread Dick Visser
I'm sorry but I don't understand. What you describe sounds exactly like what a simple template task would do? On Thu, 23 Mar 2023 at 07:57, Hiero-nymo wrote: > > When something is added to the template then the file will be updated > accordely but if you removed by example some parameters in

Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-23 Thread Hiero-nymo
When something is added to the template then the file will be updated accordely but if you removed by example some parameters in template then nothing happens in the file. The goal is to compare the file and template to see if something has changed and finally modified it. The template must be

Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-22 Thread Dick Visser
On Wed, 22 Mar 2023 at 16:37, Hiero-nymo wrote: > > The goal is to compare 2 files. The content of a file with a template file. Comparing two files (one of them is already an ansible template?) is not a goal, but rather an intermediate step. What will you do with the result of this comparison?

Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-22 Thread Hiero-nymo
The goal is to compare 2 files. The content of a file with a template file. First I'm trying to get the content of file then the template file and at the end I'll do the comparaison. So, here's the result of my cat command: [...] "stdout_lines": [ "# Ansible managed",

Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-22 Thread 'Rowe, Walter P. (Fed)' via Ansible Project
If the file content is JSON data you need to read it like JSON data. Walter -- Walter Rowe, Division Chief Infrastructure Services, OISM Mobile: 202.355.4123 On Mar 22, 2023, at 10:17 AM, Dick Visser wrote: On Wed, 22 Mar 2023 at 15:02, Hiero-nymo mailto:jer.m.me...@gmail.com>> wrote: Hi

Re: [ansible-project] How to get a list of dict with a cat from command module

2023-03-22 Thread Dick Visser
On Wed, 22 Mar 2023 at 15:02, Hiero-nymo wrote: > Hi everyone, > > I'm using the cat command with the command module to retrieve remote files > content. With a loop within a find module I get filename and call a task, > so like this: > [...] > - name: Read the content of all files > command:

[ansible-project] How to get a list of dict with a cat from command module

2023-03-22 Thread Hiero-nymo
Hi everyone, I'm using the cat command with the command module to retrieve remote files content. With a loop within a find module I get filename and call a task, so like this: [...] - name: Read the content of all files command: /usr/bin/cat {{ _files_folder.path }}/{{ file_item }}.yaml