Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.