Commit Graph

228 Commits (ad83756b48e88f443bbf8363b6a9267bae07973c)

Author SHA1 Message Date
jonathanbouvier 8257ee3e25 Fix issue with cc and bcc getting added to mail if unset (#20610) 2017-01-25 11:47:37 +00:00
David Barroso 61243f0d99 First release of the callback selective.py (#17309) 2017-01-23 11:54:47 -08:00
Marius Gedminas 0a7f2c202b Improve --diff output when files lack trailing newlines
The behavior now matches GNU diff.

Fixes #14094.

Example of output before this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null+curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

after this change:

    TASK [healthchecks.io : hourly healthchecks.io ping] ***************************
    changed: [ranka]
    --- before: /etc/cron.hourly/mg-healthchecks-dot-io
    +++ after: /tmp/tmpOTvXTw
    @@ -1,2 +1,2 @@
     #!/bin/sh
    -curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null
    \ No newline at end of file
    +curl -sS https://hchk.io/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx > /dev/null

The added unit tests contain more examples.

This commit also takes care to avoid "no newline at EOF" warnings when
no_log is in effect, and also when modules return dicts rather than
strings.  (It also removes trailing whitespace from using json
serialization when diffing dicts, because I hate trailing whitespace in
Python source files, even if they're test files.)
2017-01-09 11:49:03 -05:00
Brian Coca 08e0f6ada5 allow modules to set custom stats (#18946)
can be per run or per host, also aggregate or not
set_stats action plugin as reference implementation
added doc stub
display stats in calblack
made custom stats showing configurable
2017-01-05 16:38:36 -05:00
Tom Booth a37bc3788b runner_on_async_failed missing arg
missing and argument from CallbackModule
2016-12-22 16:55:46 -08:00
James Cammarata d70d279c4e Also fix default callback to use ignore_errors param
Rather than the value in the task, which may not be templated.

Related to #18289
2016-12-21 11:37:06 -06:00
Dag Wieers 39c9c6b942 Ensure that command/shell errors are displayed
This fix ensures that if there are specific module errors (in our case
the python interpreter was not found) then command and shell returns a
proper error.

It also fixes a few other imperfections that we noticed during
troubleshooting:

- Return the real RC if it were available
- Improve a dictionary evaluation using .get()
- Return an RC of -1 if it is unknown (instead of returning 0)

This fixes #18846
2016-12-16 21:46:02 -05:00
Andrea Tartaglia 59227d8c31 Removed dict.iteritems() in several other files.
This is for py3 compatibility #18506
2016-12-14 08:01:45 -08:00
Carlos E. Garcia 0b8011436d minor spelling changes 2016-12-13 13:51:13 -05:00
koralsky 4e194d71bd import reduce from six label:python3 (#18561)
* import 'reduce' from six
* import reduce in facts fix
2016-11-22 11:22:24 -08:00
Brian Coca aff5d9160a disable 'dense' callback in py26 2016-11-18 11:41:56 -05:00
Dag Wieers b7425b59ee Adapt callback functions to changes in 13f3cbaf3b 2016-11-17 19:30:42 -05:00
Dag Wieers 0036108c59 Implement destructor to ensure newline and terminal attributes
Also fixed a typo
2016-11-17 19:30:42 -05:00
Dag Wieers 2a8914e496 Reset VT100 attributes in case we get unexpected output 2016-11-17 19:30:42 -05:00
Dag Wieers cd6f577d91 Rename ansi to the more correct name vt100 2016-11-17 19:30:42 -05:00
Dag Wieers 893dc81b5e Implement our own detailed task output
Also:
- Streamline ANSI calls
- Implement v2_playbook_on_include
2016-11-17 19:30:42 -05:00
Dag Wieers 221a4e7014 Ensure we end with a newline in normal mode 2016-11-17 19:30:42 -05:00
Dag Wieers 7148023f59 Small fix so diff output starts on a new line 2016-11-17 19:30:42 -05:00
Dag Wieers 9a507b1f07 Don't try to be smart with cmd output ! 2016-11-17 19:30:42 -05:00
Dag Wieers 84e0420389 Make everything work magically !
- Support item-loops correctly
- Support notification handlers
2016-11-17 19:30:42 -05:00
Dag Wieers 589953c79b Assorted improvements
- Better switch between *dense* and *default*
- Reimplement C.COLOR* out of necessity (help!)
- Make verbose output more dense (clean up result)
- Implement our own dumper
- Improve delegation support
2016-11-17 19:30:42 -05:00
Dag Wieers 223c0011e0 Assorted fixes
- Implement delegate support
- Implement preliminary handler support
- Implement our own recap/summary (still fails)
2016-11-17 19:30:42 -05:00
Dag Wieers 1bf7e22756 Implement support for itemized tasks 2016-11-17 19:30:42 -05:00
Dag Wieers 14cfb2b230 Preliminary support for items, WIP 2016-11-17 19:30:42 -05:00
Dag Wieers 67c57a9b6b Improve readability 2016-11-17 19:30:42 -05:00
Dag Wieers 326bb24a89 Various improvements, now supports different verbosity levels 2016-11-17 19:30:42 -05:00
Dag Wieers fe6e4f8286 New "dense" callback plugin
The goal for the "dense" output is to only show changes and failures on-screen (the Unix-way).
However, since we still want to have a sense of progress, we use terminal capabilities to display progress.

 - On screen there should only be relevant stuff
    - How far are we ? (during run, last line)
    - What issues occured
    - What changes occured
    - Diff output

 - If verbosity increases, act as default output
   So that users can easily switch to default for troubleshooting

 - Leave previous task output on screen
   - If we would clear the line at the start of a task, there would often
     be no information at all
   - We use the cursor to indicate where in the task we are.
     Output after the prompt is the output of the previous task
   - Use the same color-conventions of Ansible

This is still a work in progress.
It was released to give a glimpse of what would be possible.

The Ansible callback mechanism currently does not have all the functionality we need to do this efficiently.
2016-11-17 19:30:42 -05:00
Dag Wieers 1ca4add91c Performance improvement using in-operator on dicts
Just a small cleanup for the existing occurrences.

Using the in-operator for hash lookups is faster than using .keys()
http://stackoverflow.com/questions/29314269/why-do-key-in-dict-and-key-in-dict-keys-have-the-same-output
2016-11-17 12:33:04 -05:00
Ievgen Khmelenko 619f2fd210 ansible-logstash-callback (#18282)
* ansible-logstash-callback

* GPL v3 license preamble, ImportError

* Update logstash.py
2016-11-08 11:17:05 -05:00
Toshio Kuratomi 6a3893c518 Remove direct calls to print and cleanup imports
All display of information should go through display instead of through print.
2016-11-07 17:12:36 -05:00
Samuel Boucher 911a602c79 Update syslog_json.py
Add SYSLOG_FACILITY environment variable to set syslog facility
2016-11-02 10:02:56 -04:00
Adrian Likins c0331d50dc Remove callback.CallbackBase._copy_result_exclude
Nothing seems to use this now.

Was added originally added in2d11cfab92f9d26448461b4bc81f466d1910a15e
but the code that used it was removed in
e02b98274b
2016-10-23 13:36:20 +02:00
Guido Günther 14a9bd6a1c Add foreman callback plugin (#17141) 2016-10-03 00:12:12 -04:00
Makc c6fa701ab1 jabber callback (#16981)
* jabber callback

* delete empty lines

* grammar fix

* fix: do not print error when jabber callback disabled

* change callback version 1 -> 2
2016-09-30 12:06:53 -04:00
Toshio Kuratomi 70e63ddf6c Fix cow mode to work with unicode task and play names (#17576)
Fixes #17560
2016-09-14 20:02:35 -07:00
Brian Coca 4656b6a846 added msg info to unreachable for oneline callback
fixes #17367
2016-09-14 11:33:01 -04:00
Brian Coca 7450629733 better display for free strategy (#17355) 2016-09-13 12:59:32 -04:00
Brian Coca cd2f60e11a take delegated vars before removing them
fixes #17455
2016-09-09 09:55:24 -04:00
Toshio Kuratomi 4ed88512e4 Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423)
We couldn't copy to_unicode, to_bytes, to_str into module_utils because
of licensing.  So once created it we had two sets of functions that did
the same things but had different implementations.  To remedy that, this
change removes the ansible.utils.unicode versions of those functions.
2016-09-06 22:54:17 -07:00
Brian Coca ff34f5548d Dynamic role include (#17401)
* dynamic role_include

* more fixes for dynamic include roles

* set play yfrom iterator when dynamic

* changes from jimi-c

* avoid modules that break ad hoc

TODO: should really be a config
2016-09-05 20:07:58 -04:00
Andrew Gaffney f65a3ce547 Support for specifying item label in a loop (#17294) 2016-08-31 09:59:43 -04:00
Chris Faulkner dbab23e68f Fix context_demo callback plugin. (#17235) 2016-08-25 10:22:27 -07:00
Toshio Kuratomi a22909c226 Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
Adrian Likins 71118b2720 Show where plugins were loaded in vvv/vvvv (#15757)
Make the plugin loading info displayed by callback plugins
match.

In debug mode (ANSIBLE_DEBUG=1 env), log all requests for
plugins including already cached plugins and class_only
requests.
2016-08-23 11:54:14 -04:00
Adrian Likins f21df311bc Fix hipchat callback "has no attribute display'" (#16998)
Use self._display for access to display object for
the hipchat callback plugin.

Fixes #16946
2016-08-08 11:04:06 -04:00
Matt Clay e07fbba0a5 Add missing boilerplate code. (#16980) 2016-08-05 12:22:52 -07:00
James Pic d2438b6b6b Debug output callback (#16839)
* Added debug output callback

* Better import

* Comment on line
2016-08-05 13:57:13 -04:00
Matt Martz 4065acc37d indent callback output if using 3verbosity or higher (#16231) 2016-07-23 18:10:53 -04:00
Brian Coca 729686a434 added back spaces for profile_tasks formatting 2016-07-06 15:39:09 -04:00
NAGA RAVI CHAITANYA ELLURI b312a43544 fix(callback-mail plugin): fixes the warning 'TaskResult' object has no attribute '__getitem__' because of which its not sending an email on failure (#16547) 2016-07-01 13:25:48 -04:00