Friday 21 April 2017

how can I pass ansible extra variables and assign to ansible playbook via nodejs

I have installed node-ansible for call ansible playbook. its works fine, But I need to pass some extra variables to ansible-playbook using nodejs.

I know ansible command line to pass to pass the extra vaibles and get this variables values in with in ansible-playbook.

ansible-playbook release.yml --extra-vars "version=1.23.45 other_variable=foo"

and get vales with in the ansible-playbook:

same things i need to do via nodejs

I saw the node-ansible document

// The command above translates to the following shell execution: ansible-playbook my-playbook.yml. // Playbook variables can be set as follows:

var command = new Ansible.Playbook().playbook('my-playbook') .variables({ foo: 'bar' });

// which translates to the following shell execution: // // > ansible-playbook my-playbook.yml -e 'foo=bar' //

How can I get pass variables(foo) in ansible-playbook?

and

This way variables to assign environment variable, But I need to pass extra variables based on above ansible-cli

Suggest me How pass extra variables using nodejs.



via Rajkumar .E

No comments:

Post a Comment