mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cb3c6417dd
##### Issue Type: Bugfix Pull Request ##### Ansible Version: ansible 1.4.3 ##### Environment: N/A ##### Summary: We are using a wrapper python script to run ansible-playbook. We use subprocess to execute and print the stdout as and when its written. Problem is when we use pause it doesn't display the prompt string as raw_input does not flush stdout before reading from stdin. It looks like a dirty fix to add "\n" to the prompt string but i don't see any other way to over come this. If anyone else have a better fix please do propose/suggest. ##### Steps To Reproduce: ```yaml #File: test_play.yml - name: Test hosts: $nodes gather_facts: false tasks: - name: Waiting for User local_action: pause prompt="Do you want to continue (yes/no)? " ``` ```python #!/usr/bin/env python #File: test.py import shlex, subprocess def run_process(process): process = process.encode("utf-8") command = shlex.split(process) p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) for line in iter(p.stdout.readline, b''): print line, cmd = "/usr/bin/python -u /usr/bin/ansible-playbook -i hosts.txt test_play.yml -e 'nodes=local'" run_process(cmd) ``` ``` shell $ python test.py ``` ##### Expected Results: ``` PLAY [Test] ******************************************************************* TASK: [Waiting for User] ****************************************************** [localhost] Do you want to continue (yes/no)? : ``` ##### Actual Results: ``` PLAY [Test] ******************************************************************* TASK: [Waiting for User] ****************************************************** [localhost] ``` |
||
---|---|---|
bin | ||
docs/man | ||
docsite | ||
examples | ||
hacking | ||
legacy | ||
lib/ansible | ||
library | ||
packaging | ||
plugins | ||
test | ||
.gitignore | ||
CHANGELOG.md | ||
CODING_GUIDELINES.md | ||
CONTRIBUTING.md | ||
COPYING | ||
Makefile | ||
MANIFEST.in | ||
README.md | ||
RELEASES.txt | ||
setup.py | ||
VERSION |
Ansible
Ansible is a radically simple configuration-management, application deployment, task-execution, and multinode orchestration engine.
Read the documentation and more at http://ansible.com/
Many users run straight from the development branch (it's generally fine to do so), but you might also wish to consume a release. You can find instructions here for a variety of platforms. If you want a tarball of the last release, go to releases.ansible.com and you can also install with pip.
Design Principles
- Have a dead simple setup process and a minimal learning curve
- Be super fast & parallel by default
- Require no server or client daemons; use existing SSHd
- Use a language that is both machine and human friendly
- Focus on security and easy auditability/review/rewriting of content
- Manage remote machines instantly, without bootstrapping
- Allow module development in any dynamic language, not just Python
- Be usable as non-root
- Be the easiest IT automation system to use, ever.
Get Involved
- Read Contributing.md for all kinds of ways to contribute to and interact with the project, including mailing list information and how to submit bug reports and code to Ansible.
- All code submissions are done through pull requests. Take care to make sure no merge commits are in the submission, and use "git rebase" vs "git merge" for this reason. If submitting a large code change (other than modules), it's probably a good idea to join ansible-devel and talk about what you would like to do or add first and to avoid duplicate efforts. This not only helps everyone know what's going on, it also helps save time and effort if we decide some changes are needed.
- irc.freenode.net: #ansible
Branch Info
- Releases are named after Van Halen songs.
- The devel branch corresponds to the release actively under development.
- Various release-X.Y branches exist for previous releases
- We'd love to have your contributions, read "CONTRIBUTING.md" for process notes.
Author
Michael DeHaan -- michael@ansible.com