Michael DeHaan
e9d11173cd
Remove obsolete comment
13 years ago
Seth Vidal
a7a083d882
when --step isn't specified make sure to print the banner
13 years ago
Seth Vidal
7687c2caf8
add --step option to ansible-playbooks to let people step through a playbook
...
one by one - asking for confirmation along the way.
also allows to 'continue' after a certain point
13 years ago
Michael DeHaan
c92bfb7234
Merge branch 'madcow2' of git://github.com/bcoca/ansible into devel
13 years ago
Jimmy Tang
81a34c2d1d
Cowsay on OSX macports
13 years ago
Stephen Fromm
fa07604d43
Fix CliRunnerCallbacks.on_file_diff in callbacks.py
...
When running ansible -C, I get a traceback that ends with
AttributeError: Values instance has no attribute 'diff'
This fixes on_file_diff to behave similar to
PlaybookRunnerCallbacks.on_file_diff().
13 years ago
Brian Coca
e9907e9c8a
added random cow pick through ANSIBLE_COW_SELECTION env var
...
Signed-off-by: Brian Coca <bcoca@tablethotels.com>
13 years ago
Stoned Elipot
10e9f1fc1e
Implement --diff for the copy module.
13 years ago
Michael DeHaan
c4779d95b8
Removing unused import, 'make pyflakes' is now clean.
13 years ago
Blair Zajac
fa8e653011
Simplify and correct comparisons with None.
13 years ago
Michael DeHaan
72a05ae2a0
Move diff code more into runner code.
13 years ago
Michael DeHaan
a9162a86f2
Very basic --diff option for showing what happens when templates change.
...
Probably output is not useful if not used with --limit
Works well with --check mode
13 years ago
Rodney Quillo
395093e0bf
Move default arguments to the end of the function call.
13 years ago
Rodney Quillo
7ae100611c
Adding default on vars_prompt
13 years ago
Dag Wieers
cd930d2e34
Change message when a play matches no hosts
...
I guess my previous pull request was confusing, by changing the message to something we already do for tasks, it makes it more clear.
Just like we say:
TASK: [foo bar]
skipping: [system01]
The message now is more clear:
PLAY [wagawaga] *******************************
skipping: no hosts matched
It makes it clear that we are skipping the play, just as is done for a task when a condition is not met.
13 years ago
Dag Wieers
d42eb2563b
Make --oneline return one line (except with multiline output)
...
Currently the message prepared for --oneline mode adds a newline to the msg-string, which is then printed (adding another newline). This change removes the added newline so that successes and failures do not differ in output (except if the output is multiline).
13 years ago
Daniel Hokka Zakrisson
e05e514861
Create a plugin loader system
13 years ago
Lorin Hochstein
1c5ac5cac8
Pretty-print "msg" when task fails
...
Several modules (e.g., pip) return stdout and stderr together in a "msg" variable (and the module development docs seem to suggest that the standard practice is to return status in this variable).
This change ensures that it is printed out with correct formatting (most importantly, with newlines appearing as newlines instead of \n).
13 years ago
Michael DeHaan
8c3abe7e52
Fix cowsay! Moo.
13 years ago
Michael DeHaan
f3407dec0e
Merge branch 'basedir-plugins' of git://github.com/dhozac/ansible into devel
13 years ago
Brian Coca
e98153d26d
cowsay for BSD!
...
Signed-off-by: Brian Coca <briancoca+ansible@gmail.com>
13 years ago
Daniel Hokka Zakrisson
ab44a4abba
Load additional plugins from path specified in configuration
13 years ago
Daniel Hokka Zakrisson
1aaf86069a
Look for plugins in the playbook's basedir
13 years ago
Jan-Piet Mens
051f66cf16
Not for cow lovers: optionally disable cowsay
...
spaces now cow-compatible
13 years ago
Michael DeHaan
d14741799a
Merge pull request #1204 from dagwieers/fatal-red
...
Make fatal errors red
13 years ago
Michael DeHaan
459d9ea30d
Merge pull request #1205 from dagwieers/ignore-cyan
...
Make ignored/skipped different from changed
13 years ago
Dag Wieers
f11ab4383a
Make ignored/skipped different from changed
...
Since a skipped/ignored action is _very_ different from actual changes to a system, it always bothered me that it was not easily distinguishable when skimming the output. This change makes ignore/skip a different color, and I chose cyan. Contemplated using dark-gray/blue, but prefered something that is readable with most terminal colors.
13 years ago
Dag Wieers
7acc0a632b
Make fatal errors red
13 years ago
Dag Wieers
20c1a67711
Abort a play at the start when no hosts matches, or no hosts are remaining
...
This change makes a distinction between no_hosts_matched and no_hosts_remaining.
In both cases we do not start facts-gathering, or run any tasks.
In the case that there are no more hosts remaining, we abort running tasks and abort the playbook.
I also cleaned up the leftovers from the previous patchsets, as these are no longer required.
This closes #1187 .
Example playbook:
```yaml
---
- hosts: emptygroup
tasks:
- action: command date
- action: command false
- hosts: all
gather_facts: False
tasks:
- action: command ls
- action: command false
- action: command true
- hosts: all
tasks:
- action: command true
- action: command false
- hosts: all
tasks:
- action: command pwd
```
13 years ago
Michael DeHaan
14f7c85ce7
Include a space and a colon after prompts, so you don't have to put them in yourself. Consistent with documented behavior in examples/playbooks/prompts.yml
13 years ago
Michael DeHaan
5683277e4a
Be smarter about when to abort a playbook -- if it's early, we just didn't match any hosts, so keep on, hosts might be dynamic.
13 years ago
Michael DeHaan
a2f76c1c69
If all hosts in a play fail, fail the whole playbook and don't bother printing out every remaining task.
13 years ago
Stephen Fromm
cf3e368d15
Add message reporting skipped action in cli callback
13 years ago
Michael DeHaan
c63189f650
Make output be cleaner on multi-line failed commands and parse errors.
13 years ago
Michael DeHaan
8e71b26264
Fix up 'changed' playbook output patch
13 years ago
Dane Summers
04c535b1e9
Modified 'ok' to 'changed' when a change has occured
13 years ago
Michael DeHaan
633e513a65
Modular server-side actions (squash merge)
13 years ago
Michael DeHaan
f41d3b9bd2
Fix skipped callback
13 years ago
Michael DeHaan
96f257cea1
Fix invocation-output-supression code to still provide invocation data to the callbacks.
13 years ago
Daniel Hokka Zakrisson
7a201dbb2e
Keep result pristine for ignore_errors
13 years ago
Michael DeHaan
c04f00e3a6
Fix async callback
13 years ago
Daniel Hokka Zakrisson
2d448f2a34
Invoke cowsay without going through the shell
13 years ago
Ludovic Claude
b0a4a9e188
Issue #935 : filter out __init__ module from the list of callbacks
13 years ago
Michael DeHaan
3de4e45741
Move plugin directories
13 years ago
Michael DeHaan
bf92a9e4e0
Store invocation differently from an API perspective, but hide in callbacks
13 years ago
Grzegorz Nosek
94f56614e7
Fix UTF-8 output when using executable inventory files
...
The 'hostname' variable is then unicode, which breaks interpolating
stdout etc. contents into the output strings (they are bytes and cannot
be converted to Unicode using ASCII codec)
13 years ago
Michael DeHaan
3017dc92d9
make callbacks modular
14 years ago
Michael DeHaan
0579b8b4e6
The command module was not reporting on errors like the other modules when the module failed
...
to parse or return other valid output. This is a slight improvement.
14 years ago
Michael DeHaan
72faf8eb0a
fix indents
14 years ago
Rodney Quillo
d1f821361d
vars_prompt encrypt from mgw
14 years ago
Michael DeHaan
85ba71a7fe
Split -vv from -vvv
14 years ago
Michael DeHaan
846186e2fc
Add -vvv support for debugging activity
14 years ago
Michael DeHaan
faed4b5a33
whitespace + remove deprecated YAML parser (migration script lives in examples/scripts and warning was added
...
in 0.6 release)
14 years ago
Michael DeHaan
227dfc17f3
fix tree output
14 years ago
Seth Vidal
f924c96370
remove the tab I found
...
DIE TAB DIE
pep8
14 years ago
Petros Moisiadis
2ac4acbf97
fixes for tests
14 years ago
Petros Moisiadis
5f4bf813b1
added an 'ignore_errors' option to tasks
...
Failed tasks with ignore_errors=True, allow the remaining tasks in the
play to be executed as if no failure happened. A failure notice is still
written to the output as well as an '...ignoring' message.
14 years ago
Petros Moisiadis
c717934b7e
Improved 'vars_prompt' syntax to support prompt text and (non-)private input
...
An example of the new syntax:
vars_prompt:
- name: 'secret_variable_name"
prompt: "Enter secret value: "
private: "yes"
- name: "nonsecret_variable_name"
prompt: "Enter non-secret value: "
private: "no"
14 years ago
Michael DeHaan
e035ce97ce
blue on black, tears on a river, push on a shove, it don't mean much
...
(make colorized playbook runs not suck on black terminals)
14 years ago
Michael DeHaan
8d7f526df6
importing/not-importing methods should be colorized
14 years ago
Michael DeHaan
d3e8e8ff54
Fix output message
14 years ago
Michael DeHaan
263432daa1
Changed no hosts to red. Not sure this is the right color choice, but there is no orange :)
14 years ago
Michael DeHaan
15062b38e1
Fix typo
14 years ago
Michael DeHaan
12ff9b5b9a
Move color coding bits to module, use over rest of playbook
14 years ago
Timothy Appnel
4b9b9a8a5b
Importing re in runner for doing conditional tasks using pattern matching i.e. re.search(). Also conditionally outputting item when skipping.
14 years ago
Michael DeHaan
d72c0c8898
replace module daisy-chaining logic
14 years ago
Derek Carter
34e2584220
improved output in with_items fixes : #627
14 years ago
Dave Hatton
c3205595b3
format fixes to make fetch more usable
14 years ago
Michael DeHaan
1754de3335
Misc code cleanup, mostly whitespace preferences, removing unused imports, plus a few fixes here and there.
14 years ago
Michael DeHaan
867b2437cc
consolidate output code in callbacks.py, from utils, remove extra functions
14 years ago
Michael DeHaan
68a9adc1be
Indentation cleanup (partial)
14 years ago
Michael DeHaan
706cfd9ade
Misc cleanup -- moved function out of utils, removed debug statement.
14 years ago
Michael DeHaan
279b5965b8
Much streamlining around setup steps in playbooks, now only run setup once per play.
14 years ago
Ingo Gottwald
26aa4e2469
Enabled cowsay support for Ubuntu
14 years ago
Dave Hatton
7ecdb83800
improve output formating for playbook
14 years ago
Michael DeHaan
efac68b636
Remove the -D module debug flag, which no longer is functional due to sudo pty requirements, and replace with -v/--verbose.
...
This flag will show playbook output from non-failing commands. -v is also added to /usr/bin/ansible, but not yet used.
I also gutted some internals code dealing with 'invocations' which allowed the callback to know what module invoked
it. This is not something 0.5 does or needed, so callbacks have been simplified.
14 years ago
Michael DeHaan
0972b761de
Leverage cowsay if installed.
14 years ago
Michael DeHaan
6d580aea02
As part of a precursor to other refactoring, make returns less list-like throughout runner.
14 years ago
Jeroen Hoekx
f14c1e3e91
Async: print one poll message per polling cycle.
...
Instead of one per host per polling cycle.
14 years ago
Jeroen Hoekx
ce9a8c9ffc
Introduce Async API in Runner.
14 years ago
Michael DeHaan
36e454c52f
Because paramiko using a pty can't distinguish stderr and stdout, remove handling that
...
treated -D as a way to show stderr, and make sure modules don't include things on stderr.
Update docs and test module script to come into line.
14 years ago
Michael DeHaan
c00699d0ef
Merge branch 'integration'
...
Conflicts:
lib/ansible/playbook.py
lib/ansible/runner.py
library/apt
14 years ago
Michael DeHaan
321ed53e3a
Fetch module doesn't set invocation parameter as it invokes nothing, so don't let that be an error.
14 years ago
Rafal Lewczuk
a87c77958c
clean exec bits from lib/ansible/*.py, ignore Eclipse/PyDev files
14 years ago
Michael DeHaan
08c593bee1
Warn if no hosts matched
14 years ago
Michael DeHaan
e5d5b072db
Merge remote branch 'public/integration'
14 years ago
Seth Vidal
bcef25f7eb
add vars_prompt to playbooks
...
- this allows some vars to be prompted for at the start of the playbook
setup
- defaults to no output since this would mostly be used for passwords
14 years ago
John Eckersberg
2dad8cc27c
Remove shebang from callbacks.py
...
It is not +x, and has no __main__. It draws ire of rpmlint.
14 years ago
Michael DeHaan
2511992659
Surface module debug (-D) to /usr/bin/ansible also
14 years ago
Jeroen Hoekx
74ae4b29ad
Add a debug attribute to Runner/Playbook.
...
This prints the stderr of the executed modules on local stderr.
Most methods on Runner now return a fourth "err" parameter.
14 years ago
Michael DeHaan
b1471bf857
Add more comments to the callbacks file
14 years ago
Michael DeHaan
95670ce6b5
remove unused function
14 years ago
Michael DeHaan
f074f1c4c4
Fixes from pyflakes
14 years ago
Michael DeHaan
35c8750bbb
Fix tree view to work with callbacks
14 years ago
Michael DeHaan
45a455a805
Make /usr/bin/ansible output realtime and also delete some code!
14 years ago
Michael DeHaan
6dda6f12dc
Applying callback model to runner, and using that in playbooks, so output can be more immediate in playbooks.
...
(Runner still does not use callbacks for default output)
14 years ago
Michael DeHaan
6ab615c724
Code cleanup for playbooks, also added 'on_skipped' callback
14 years ago
Michael DeHaan
7ed734dfb2
move callbacks to seperate file, anticipating callbacks for Runner() as well
14 years ago