File created by ansible script module not present after running against remote nodeHow to use SSH to run a shell script on a remote machine?bootstrapping ansible prerequisites with the script module. python required?ansible: Is there something like with_fileglobs for files on remote machine?Access ansible playbook results after run of playbookAnsible playbook for remote copy and script executionAnsible script module - Control socket permission deniedRestrict Ansible script module using sudoers on the remote nodeVagrant ansible provisioner throwing error 'MODULE FAILURE' when running playbookAnsible Playbook freezes on running a remote shell script having sudoShell script execution is not working in remote server Ansible (previous tasks executed successfully)

Is an entry level DSLR going to shoot nice portrait pictures?

LuaLaTex - how to use number, computed later in the document

How can I get an unreasonable manager to approve time off?

Traversing Oceania: A Cryptic Journey

A word that means "blending into a community too much"

If I leave the US through an airport, do I have to return through the same airport?

Fermat's statement about the ancients: How serious was he?

Why does logistic function use e rather than 2?

Should I ask for an extra raise?

What to do when surprise and a high initiative roll conflict with the narrative?

How to hide rifle during medieval town entrance inspection?

How does the Around command at zero work?

You have (3^2 + 2^3 + 2^2) Guesses Left. Figure out the Last one

Is it expected that a reader will skip parts of what you write?

Is White controlling this game?

Is it legal for a bar bouncer to confiscate a fake ID

ed command: Delete from line 1 until the first blank line

Interval of parallel 5ths in the resolution of a German 6th chord

New pedal fell off maybe 50 miles after installation. Should I replace the entire crank, just the arm, or repair the thread?

What is the color of artificial intelligence?

A strange trigonometric identity

Who are the Missing Members of this Noble Family?

Meaning of 'lose their grip on the groins of their followers'

Cascading Switches. Will it affect performance?



File created by ansible script module not present after running against remote node


How to use SSH to run a shell script on a remote machine?bootstrapping ansible prerequisites with the script module. python required?ansible: Is there something like with_fileglobs for files on remote machine?Access ansible playbook results after run of playbookAnsible playbook for remote copy and script executionAnsible script module - Control socket permission deniedRestrict Ansible script module using sudoers on the remote nodeVagrant ansible provisioner throwing error 'MODULE FAILURE' when running playbookAnsible Playbook freezes on running a remote shell script having sudoShell script execution is not working in remote server Ansible (previous tasks executed successfully)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm setting up some server in AWS, and want to use Ansible to do some shell in remote nodes. I write playbook as follow



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh


remote nodes a.sh as follow



#!/usr/bin/env bash
echo "test">> test.txt
python writejson.py



But when I check the test.text, I find it doesn't work in remote nodes.help me please.










share|improve this question
























  • Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

    – Charles Duffy
    Mar 24 at 19:03












  • If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

    – Charles Duffy
    Mar 24 at 19:05

















0















I'm setting up some server in AWS, and want to use Ansible to do some shell in remote nodes. I write playbook as follow



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh


remote nodes a.sh as follow



#!/usr/bin/env bash
echo "test">> test.txt
python writejson.py



But when I check the test.text, I find it doesn't work in remote nodes.help me please.










share|improve this question
























  • Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

    – Charles Duffy
    Mar 24 at 19:03












  • If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

    – Charles Duffy
    Mar 24 at 19:05













0












0








0








I'm setting up some server in AWS, and want to use Ansible to do some shell in remote nodes. I write playbook as follow



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh


remote nodes a.sh as follow



#!/usr/bin/env bash
echo "test">> test.txt
python writejson.py



But when I check the test.text, I find it doesn't work in remote nodes.help me please.










share|improve this question
















I'm setting up some server in AWS, and want to use Ansible to do some shell in remote nodes. I write playbook as follow



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh


remote nodes a.sh as follow



#!/usr/bin/env bash
echo "test">> test.txt
python writejson.py



But when I check the test.text, I find it doesn't work in remote nodes.help me please.







shell ansible






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 24 at 19:05









Charles Duffy

186k28215268




186k28215268










asked Mar 24 at 19:01









jianweijianwei

35




35












  • Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

    – Charles Duffy
    Mar 24 at 19:03












  • If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

    – Charles Duffy
    Mar 24 at 19:05

















  • Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

    – Charles Duffy
    Mar 24 at 19:03












  • If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

    – Charles Duffy
    Mar 24 at 19:05
















Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

– Charles Duffy
Mar 24 at 19:03






Which directory do you expect that file to be created in? And, err, why are you making the assumption that the created file will be in the specific directory you're looking in? :)

– Charles Duffy
Mar 24 at 19:03














If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

– Charles Duffy
Mar 24 at 19:05





If you want to control which directory is used, pay attention to the chdir argument in docs.ansible.com/ansible/latest/modules/script_module.html

– Charles Duffy
Mar 24 at 19:05












1 Answer
1






active

oldest

votes


















0














Assuming that you want test.txt to be created in the experiment directory, this should be changed to something like:



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh
args:
chdir: /home/ubuntu/FastBFT_ethereum/experiment





share|improve this answer

























  • Thank you very much for solving my problem.

    – jianwei
    Mar 24 at 19:39











  • Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

    – Charles Duffy
    Mar 24 at 19:40











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327409%2ffile-created-by-ansible-script-module-not-present-after-running-against-remote-n%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Assuming that you want test.txt to be created in the experiment directory, this should be changed to something like:



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh
args:
chdir: /home/ubuntu/FastBFT_ethereum/experiment





share|improve this answer

























  • Thank you very much for solving my problem.

    – jianwei
    Mar 24 at 19:39











  • Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

    – Charles Duffy
    Mar 24 at 19:40















0














Assuming that you want test.txt to be created in the experiment directory, this should be changed to something like:



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh
args:
chdir: /home/ubuntu/FastBFT_ethereum/experiment





share|improve this answer

























  • Thank you very much for solving my problem.

    – jianwei
    Mar 24 at 19:39











  • Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

    – Charles Duffy
    Mar 24 at 19:40













0












0








0







Assuming that you want test.txt to be created in the experiment directory, this should be changed to something like:



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh
args:
chdir: /home/ubuntu/FastBFT_ethereum/experiment





share|improve this answer















Assuming that you want test.txt to be created in the experiment directory, this should be changed to something like:



- hosts: remote-nodes
tasks:
- name: Execute script
script: /home/ubuntu/FastBFT_ethereum/experiment/a.sh
args:
chdir: /home/ubuntu/FastBFT_ethereum/experiment






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 24 at 19:12

























answered Mar 24 at 19:06









Charles DuffyCharles Duffy

186k28215268




186k28215268












  • Thank you very much for solving my problem.

    – jianwei
    Mar 24 at 19:39











  • Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

    – Charles Duffy
    Mar 24 at 19:40

















  • Thank you very much for solving my problem.

    – jianwei
    Mar 24 at 19:39











  • Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

    – Charles Duffy
    Mar 24 at 19:40
















Thank you very much for solving my problem.

– jianwei
Mar 24 at 19:39





Thank you very much for solving my problem.

– jianwei
Mar 24 at 19:39













Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

– Charles Duffy
Mar 24 at 19:40





Glad to help! If the problem is indeed solved, please click the checkbox to the left, which will make the question show up as no longer needing answers.

– Charles Duffy
Mar 24 at 19:40



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55327409%2ffile-created-by-ansible-script-module-not-present-after-running-against-remote-n%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript