Created
November 1, 2013 03:58
-
-
Save willthames/7260782 to your computer and use it in GitHub Desktop.
Demonstration of long running script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[will@tangerine nohup-test]$ ansible-playbook playbook.yml --limit 127.0.0.1 | |
PLAY [all] ******************************************************************** | |
GATHERING FACTS *************************************************************** | |
ok: [127.0.0.1] | |
TASK: [run long running script] *********************************************** | |
^CTraceback (most recent call last): | |
File "/home/will/src/ansible/bin/ansible-playbook", line 268, in <module> | |
sys.exit(main(sys.argv[1:])) | |
File "/home/will/src/ansible/bin/ansible-playbook", line 208, in main | |
pb.run() | |
File "/home/will/src/ansible/lib/ansible/playbook/__init__.py", line 263, in run | |
if not self._run_play(play): | |
File "/home/will/src/ansible/lib/ansible/playbook/__init__.py", line 578, in _run_play | |
if not self._run_task(play, task, False): | |
File "/home/will/src/ansible/lib/ansible/playbook/__init__.py", line 363, in _run_task | |
results = self._run_task_internal(task) | |
File "/home/will/src/ansible/lib/ansible/playbook/__init__.py", line 322, in _run_task_internal | |
results = runner.run() | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 972, in run | |
results = [ self._executor(h, None) for h in hosts ] | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 392, in _executor | |
exec_rc = self._executor_internal(host, new_stdin) | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 483, in _executor_internal | |
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args) | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 674, in _executor_internal_inner | |
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args) | |
File "/home/will/src/ansible/lib/ansible/runner/action_plugins/normal.py", line 54, in run | |
return self.runner._execute_module(conn, tmp, module_name, module_args, inject=inject, complex_args=complex_args) | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 358, in _execute_module | |
res = self._low_level_exec_command(conn, cmd, tmp, sudoable=sudoable) | |
File "/home/will/src/ansible/lib/ansible/runner/__init__.py", line 751, in _low_level_exec_command | |
rc, stdin, stdout, stderr = conn.exec_command(cmd, tmp, sudo_user, sudoable=sudoable, executable=executable) | |
File "/home/will/src/ansible/lib/ansible/runner/connection_plugins/local.py", line 84, in exec_command | |
stdout, stderr = p.communicate() | |
File "/usr/lib64/python2.7/subprocess.py", line 754, in communicate | |
return self._communicate(input) | |
File "/usr/lib64/python2.7/subprocess.py", line 1312, in _communicate | |
stdout, stderr = self._communicate_with_poll(input) | |
File "/usr/lib64/python2.7/subprocess.py", line 1366, in _communicate_with_poll | |
ready = poller.poll() | |
KeyboardInterrupt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- hosts: all | |
connection: local | |
tasks: | |
- name: run long running script | |
action: command ./sleeper.sh 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
(nohup sleep $1 2>&1 > sleep.out &) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[will@tangerine nohup-test]$ ansible --version | |
ansible 1.4 (devel d478eaa6a5) last updated 2013/11/01 13:33:01 (GMT +1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment