Created
July 29, 2020 06:44
-
-
Save zeitounator/52956f5ea378335c5e6a9b47df13edca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Node test | |
hosts: localhost | |
gather_facts: False | |
tasks: | |
- debug: | |
var: titi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Ansible = require('node-ansible') | |
var command = new Ansible.Playbook().playbook('test'); | |
command.on('stdout', function(data) { console.log(data.toString()); }); | |
command.on('stderr', function(data) { console.log(data.toString()); }); | |
command.variables({toto: 'Fake var we don\'t use', titi: 'Our test var set in js'}); | |
command.exec(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ node test_node_script.js | |
PLAY [Node test] *************************************************************** | |
TASK [debug] ******************************************************************* | |
ok: [localhost] => { | |
"titi": "Our test var set in js" | |
} | |
PLAY RECAP ********************************************************************* | |
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment