From a414b3c9782dc97ef30d2d8fb0df4e96c3379e30 Mon Sep 17 00:00:00 2001 From: ManchukondaManoj Date: Mon, 3 Jun 2019 12:19:00 +0530 Subject: [PATCH] Added file() method which takes environment file as input. Which does the functionality -e '@/home/user/file.yml' --- lib/ansible.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ansible.js b/lib/ansible.js index 4bb7e87..bc49384 100644 --- a/lib/ansible.js +++ b/lib/ansible.js @@ -243,6 +243,11 @@ var Playbook = function () { return this; } + this.file = function(file){ + this.config.file = file; + return this + } + this.variables = function(variables) { this.config.variables = variables; return this; @@ -288,6 +293,11 @@ var Playbook = function () { this.config.playbook + ".yml" ]; + if(this.config.file){ + let fileArg = this.config.file + result = result.concat('-e', fileArg) + } + if (this.config.variables) { var args = JSON.stringify(this.config.variables); result = result.concat('-e', args);