shaharke/node-ansible — pull request #5 by KRMV (2014-10-10 23:10:09+00:00)
Title: Tojson+silent

I need to be able to parse ansible response as JSON, and having silent mode.

So, now, it can add a json array to result, which is a collection of object using this model:
```json
{ "host": "XXX",
"code": "success|FAILED",
"data": {"var1": "value1", "var2": "value2", ...}
}
```
so final result is :
```json
{ "code": "XXX",
"output": "XXX",
"json": [ { "host": "XXX", "code": "XXX", "data": "XXX" }, {}, "..." ]
}
```

for compatibility, option must be toggled on using exec({json: true});

I added to silent mode to shelljs,
for compatibility, option must be toggled on using exec({silent: true});

I'ld test more as soon (code) as I far as I would use ansible for my projects.

Ex:
```javascript
var Ansible = require('node-ansible');

var cmd = new Ansible.AdHoc().hosts('call').module('mysql_replication').user('root').args({mode: 'getslave'}).verbose(0);
var go = cmd.exec({json: true, silent: true});

go.then(function (result) {
for(var i in result.json) {
console.log('Host: ', result.json[i].host, ' DB is ', result.json[i].data['Slave_IO_Running'], result.json[i].data['Slave_SQL_Running'], ' with ', result.json[i].data['Seconds_Behind_Master'], 's');
}
}
```

results:
> Host: HOST1 DB is Yes Yes with 0 s
> Host: HOST2 DB is Yes Yes with 0 s
> Host: HOST3 DB is Yes Yes with 0 s