This is do-able as I just wrote a module for my current employer that does just this. The module needs to be cleaned up but I'll see if they are willing to opensource it. <-- could be a while... The module works by grabbing each interface's IP and CIDR Mask. I then process the routing table to get a list of gateways I should be able to hit per interface. I then run the ping command to all the gateways recording the success or failure. For interfaces that don't have any routes, I created a second test where it generates the first two host IPs in the network and it pings them. If one of those return successful the module considers it as a pass. All pings and data are collected and processed before a call to module.fail is called so I can include all of the test results in the output. This took about 2 days to write and another half day testing across several distros to give you an idea if you wanted to attempt yourself.
-Chris On Tuesday, February 9, 2016 at 1:07:41 PM UTC-6, Portia Wong wrote: > > Currently at my workplace, our hosts have multiple connections to > different gateways. I am trying to find a way to see whether I can easily > ping 4-5 gateways by either running an ad-hoc command or through a playbook > to help me verify that after each host deployment, connection to those > gateways are successful. Has anybody ever done this before? > -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3ee2fdf3-c4ac-4b1b-827f-c4665198e0bb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
