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
register: file_contents
become: true
become_user: root
[...]
I receive a list of string (with stdout_lines) or a normal output (with
stdout) but I need to have a list because a the end I want to make a diff
with another list of dict, like this:
ok: [10.10.10.1] => {
"daten_content": [
{
"agents": [
"aaa",
"bbb"
],
"community": {
"from xyzzy"
},
"disableDimensions": true,
"Dimensions": {
"HostGroup": "abc",
"Type": "role",
"env": "TEST"
},
"fields": [
[...]
Unfortunately I cannot retrieve what I need with a split or to pipe in list.
As anyone an idea how to do that or using another module?
--
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/d14aa8a7-fd9b-49f1-967e-cdeb38d3a506n%40googlegroups.com.