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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d14aa8a7-fd9b-49f1-967e-cdeb38d3a506n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAF8BbLYb2nGLxwcHamLCB5dqbBo469su5BWRE7%2B4HdU_o%3Dohow%40mail.gmail.com.
"stdout_lines": [
      "# Ansible managed",
      "",
      "- agents:",
      "  - \"aaa\““,
      "  - \“bbb\““,
      " community:",
      "  \"#from\": \“/etc/xyz\““,
      " disableDimensions: true",
      " Dimensions:",
      "  HostGroup: \“abc\““,
      "  Type: \“role\““,
      "  environment: \“TEST\““,
      " fields:",
      "  - conversion: \“intg\““,
      "   name: \"UCD-SNMP-MIB\"",
      "   oid: \“.1.3…\““,
 […]
]
"daten_content": [
    {
      "agents": [
        "aaa",
        "bbb"
      ],
      "community": {
        “\“#from\": \“/etc/xyz\“
      },
      "disableDimensions": true,
      "Dimensions": {
        "HostGroup": "abc",
        "Type": "role",
        "env": "TEST"
      },
      "fields": [
        {
          "conv": „int“,
          "name": "UCD-SNMP-MIB",
          "oid": „.1.3…“
        },
 […]
]
I need to have the same format file to compare them. I've try many way with output of cat command but I don't find the right way and perhaps the's an easiest way??Â
Is it really better with slurp module?