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;
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
add a comment |
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
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 thechdir
argument in docs.ansible.com/ansible/latest/modules/script_module.html
– Charles Duffy
Mar 24 at 19:05
add a comment |
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
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
shell ansible
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 thechdir
argument in docs.ansible.com/ansible/latest/modules/script_module.html
– Charles Duffy
Mar 24 at 19:05
add a comment |
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 thechdir
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
add a comment |
1 Answer
1
active
oldest
votes
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
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment |
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
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
add a comment |
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
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
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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