Several things here.
You’re saving the result for each host to the same file. So you will end up with just one result, from the last host.
And there is something weird with the inventory you use. Follow the suggestion made by the code (use increased verbosity).
Well as a workaround I could use: ansible-playbook ping_email.yml >> /tmp/file.txt to save the output as a file. But I hope there could be a better way.
Registered results do not contain the full output as seen on the screen. Perhaps you want to set a log file instead, otherwise, you’ll want to use a template and build the output in the format you want. The screen output is controlled by a callback plugin which does extra formatting.
Perhaps you want to set a log file instead…Well, I don’t want to have the whole log file that contains all details of different play, but only the output of the play.
you’ll want to use a template and build the output in the format you want…
I will look into it.
It looks like I need to use a template for the task. But saving the screen output for the playbook run should be a very common task. Hope someone can write a module for doing this.
You have an invalid character in your group name, by the way. Change the dash to an underscore (probably).
Yeah, you’re correct.