Seems like a painful omission unless there is a reason for it, for now I am reduced to monkey patch it:
var playbook = new Ansible.AdHoc().module('fetch');
playbook.config.variables = {'ansible_ssh_port' : 1337};
var oldcp = playbook.compileParams;
playbook.compileParams = function()
{
var result = oldcp.bind(this)();
if (this.config.variables) {
var args = JSON.stringify(this.config.variables);
result = result.concat('-e', args);
}
return result;
}
playbook.exec();
Seems like a painful omission unless there is a reason for it, for now I am reduced to monkey patch it: