- name: Parse LookingGlass Report for Errors read_csv: path: /etc/ansible/roles/LookingGlass/files/Pentair.csv register: errors
- debug: var: errors.listok: [localhost] => { "errors.list": [ { "Customer": "Test", "ErrorCount": "19", "ErrorMessage": "an error", "Host": "host1", "RecommendedActions": "", "Severity": "LOW", }, { "Customer": "Test", "ErrorCount": "3057", "ErrorMessage": "A different error", "Host": "host1", "RecommendedActions": "", "Severity": "LOW", },
.... etc
- debug: var: errors.list.1.ErrorMessageawk -F "\"*,\"*" '{print $2}' my.csv
resource has no contentBlocked until the other thread finished using this sessionnot foundnot foundnot found
resource has no content--
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/44dc83d9-3dd2-4714-96a0-18b8dbe46f5d%40googlegroups.com.
- name: Write error log lineinfile: line: "{{ item.ErrorMessage }}" path: /tmp/errors.txt insertafter: EOF delegate_to: localhost loop: "{{ errors.list }}"