node.js - Code simulation command line command operation ansible playbook, the path is correct, the error yml file could not be found
给我你的怀抱
给我你的怀抱 2017-05-24 11:38:51
0
1
1081

Before using the vue-cli multi-page architecture modified by a brother on the Internet, calling the api code written in nodejs:

...
function getMobileListByOneUecontrol(ip , user , password , index , length , res) {
    var remotePath = '/Users/' + user + '/';
    var cmdString = 'ansible-playbook ../ansible/testgetmobilelist.yml -i '+filename +' -verbose --extra-vars \"ip=' + ip + ' user=' + user + '\"';//ddd
    exec(cmdString, function (err, stdout, stderr) {
        var returnStr;
        if (err) {
        ...

Originally there was no problem with the function, but later it was replaced. The native vue-cli wrote a single-page architecture, but an error was reported after npm run dev:

error: ERROR! the playbook: ../ansible/testgetmobilelist.yml could not be found

This is my file structure:

The js file of api is the js file in the api folder, and the called yml file is in the ansible folder. The relative path is correct:
ansible-playbook ../ansible/testgetmobilelist. yml
Please give me some advice from the masters, thank you in advance~

给我你的怀抱
给我你的怀抱

reply all(1)
过去多啦不再A梦

I don’t know how you integrated your project with the front-end project generated by vue-cli. I hope you can explain it in detail.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template