
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
ansible-playbook-cli-js
Advanced tools
A node.js wrapper for the ansible-playbook command
Ansible must be installed and accessible in the path
npm install ansible-playbook-cli-js
Then:
var AnsiblePlaybookCli = require('ansible-playbook-cli-js');
With promise
var ansiblePlaybookCli = new AnsiblePlaybookCli({
cwd: 'test1'
});
ansiblePlaybookCli.command('playbook.yml -i hosts').then(function (data) {
console.log('data = ', data);
});
//data = {
// command: 'ansible-playbook playbook.yml -i hosts ',
// raw: '["\\nPLAY [create test dir] ******************************************************** \\n\\nGATHERING FACTS *************************************************************** \\nok: [127.0.0.1]\\n\\nTASK: [create tmp2 dir] ******************************************************* \\nok: [127.0.0.1]\\n\\nPLAY RECAP ******************************************************************** \\n127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 \\n\\n",""]',
// lines:
// ['',
// 'PLAY [create test dir] ******************************************************** ',
// '',
// 'GATHERING FACTS *************************************************************** ',
// 'ok: [127.0.0.1]',
// '',
// 'TASK: [create tmp2 dir] ******************************************************* ',
// 'ok: [127.0.0.1]',
// '',
// 'PLAY RECAP ******************************************************************** ',
// '127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 ',
// '',
// ''],
// object: { host: '127.0.0.1', ok: 2, changed: 0, unreachable: 0, failed: 0 }
//}
With callback:
ansiblePlaybookCli.command('playbook.yml --inventory-file hosts', function (err, data) {
console.log('data = ', data);
});
//data = {
// command: 'ansible-playbook playbook.yml --inventory-file hosts ',
// raw: '["\\nPLAY [create test dir] ******************************************************** \\n\\nGATHERING FACTS *************************************************************** \\nok: [127.0.0.1]\\n\\nTASK: [create tmp2 dir] ******************************************************* \\nok: [127.0.0.1]\\n\\nPLAY RECAP ******************************************************************** \\n127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 \\n\\n",""]',
// lines:
// ['',
// 'PLAY [create test dir] ******************************************************** ',
// '',
// 'GATHERING FACTS *************************************************************** ',
// 'ok: [127.0.0.1]',
// '',
// 'TASK: [create tmp2 dir] ******************************************************* ',
// 'ok: [127.0.0.1]',
// '',
// 'PLAY RECAP ******************************************************************** ',
// '127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 ',
// '',
// ''],
// object: { host: '127.0.0.1', ok: 2, changed: 0, unreachable: 0, failed: 0 }
//}
With options
ansiblePlaybookCli.command('playbook.yml', { 'inventory-file': 'hosts' }).then(function (data) {
console.log('data = ', data);
});
//data = {
// command: 'ansible-playbook playbook.yml --inventory-file hosts ',
// raw: '["\\nPLAY [create test dir] ******************************************************** \\n\\nGATHERING FACTS *************************************************************** \\nok: [127.0.0.1]\\n\\nTASK: [create tmp2 dir] ******************************************************* \\nok: [127.0.0.1]\\n\\nPLAY RECAP ******************************************************************** \\n127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 \\n\\n",""]',
// lines:
// ['',
// 'PLAY [create test dir] ******************************************************** ',
// '',
// 'GATHERING FACTS *************************************************************** ',
// 'ok: [127.0.0.1]',
// '',
// 'TASK: [create tmp2 dir] ******************************************************* ',
// 'ok: [127.0.0.1]',
// '',
// 'PLAY RECAP ******************************************************************** ',
// '127.0.0.1 : ok=2 changed=0 unreachable=0 failed=0 ',
// '',
// ''],
// object: { host: '127.0.0.1', ok: 2, changed: 0, unreachable: 0, failed: 0 }
//}
FAQs
A node.js wrapper for the ansible-playbook command
We found that ansible-playbook-cli-js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.