Quantcast
Channel: How to log outcome from multiple hosts in Ansible? - DevOps Stack Exchange
Viewing all articles
Browse latest Browse all 3

How to log outcome from multiple hosts in Ansible?

$
0
0

I've a playbook that runs EOS commands against multiple devices. Currently the whole thing is done in bash, creates one massive text file log and an engineer compares each day's log to the previous one for irregularities.

I'm attempting to have one simple playbooks that runs the commands and logs to json from which it'll be easier to automate the comparison, but I've just realised only logs from one device are saved as opposed to the two I'm testing against.

---- name: Checks  hosts: myhosts  connection: local  tasks:  - name: Run Commands    eos_command:     commands:      - show ip pim neighbor | json      - show ip bgp summary | json    register: result  - name: Save to file    copy:      content: "{{ result.stdout_lines | to_nice_json }}"    dest: "/home/homedirectory/results.json"

Would there be way to log both (and eventually all production) devices in the same file?


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>