volanja / ansible_spec

It's ruby gem that connect Ansible & Serverspec for Test Driven Server Configuration(or TDD).
MIT License
228 stars 57 forks source link

json output format? #81

Closed juju4 closed 6 years ago

juju4 commented 8 years ago

Hello,

Could you support different output format, most notably json? It would permit integration with other tools like monitoring as shown here http://www.slideshare.net/m_richardson/serverspec-and-sensu-testing-and-monitoring-collide

Thanks

juju4 commented 8 years ago

edit of .rspec with "--format json" is ok but maybe a command line argument would be nice

volanja commented 8 years ago

Hi

Please try it. It might be that you want.

$ rake serverspec:Ansible-Sample-TDD SPEC_OPTS="--format json" 
juju4 commented 8 years ago

Yes, that is an option. But my problem currently is output of command is not a full json. it's an informative message

Run serverspec for ...
... rspec --pattern roles/...

and a per host json.

so how to disable first part and consolidate everything in one json? or maybe request testing only per host?

volanja commented 8 years ago

This informative message is problem of Serverspec. But, Maybe, tail command is useful.

$ rake serverspec:Ansible-Sample-TDD SPEC_OPTS="--format json"  | tail -n +3
juju4 commented 8 years ago

yes tail can leave header but what about per host json or aggregated valid one? for example

$ rake serververspec:Ansible-Sample all
$ rake serververspec:Ansible-Sample host1

and all generating a full json output

Thanks

volanja commented 7 years ago

Hmm, ansible_spec can parse config of ansible, and provide serverspec parsed information. So, I think that this problem caused by serverspec.

volanja commented 6 years ago

This issue has been marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.