Commit Graph

172 Commits (e539b2003dd0070d6de00564b6aee4f42d1a88f0)

Author SHA1 Message Date
Andrew Gaffney 0f4d1eb051 Add 'filtered' stdout callback plugin
This plugin filters output for any task that is 'ok' or 'skipped'.
It works by subclassing the 'default' stdout callback plugin and
overriding certain functions. It will suppress display of the task
banner until there is a 'changed' or 'failed' result or an
unreachable host.
2015-12-21 22:41:52 +00:00
Brian Coca be5488cb60 clean debug output to match prev versions 2015-12-15 09:27:53 -05:00
Brian Coca f3bedbae29 simplified skippy
thanks agaffney!
2015-12-12 17:50:55 -05:00
James Cammarata 14e19c239d Make on_file_diff callback item-aware 2015-12-09 14:52:53 -05:00
Brian Coca 0719eb3e2d clarified warning from tree callback 2015-12-09 07:29:12 -08:00
Brian Coca 795fac917e fixed typo in tree callback, added default dir
this would allow it to work with playbooks also
2015-12-08 11:59:04 -08:00
Matt Martz 384b2e0234 Get v2_playbook_on_start working
* Move self._tqm.load_callbacks() earlier to ensure that v2_on_playbook_start can fire
* Pass the playbook instance to v2_on_playbook_start
* Add a _file_name instance attribute to the playbook
2015-12-02 11:29:51 -06:00
Brian Coca 3e01516783 fixed signature for init on callbacks
also removed passing display to base class which already handles this
2015-12-01 14:06:54 -08:00
James Cammarata 6671d78f95 Tweak location of stats callback execution and properly relocate stats output code 2015-11-28 14:03:21 -05:00
Brian Coca 7244b5ae49 added missing : 2015-11-25 10:52:42 -08:00
Brian Coca 0ec60ac09b added missing events to base class 2015-11-25 10:49:03 -08:00
Brian Coca 83f7942dcf removed print entries, corrected display calls to match latest devel 2015-11-16 11:35:10 -08:00
Brian Coca 78be81b96d Merge pull request #12510 from jcftang/devel
Initial add of logentries callback plugin
2015-11-15 11:28:02 -08:00
Brian Coca f1db99caa7 updated with latest changes to default 2015-11-15 10:09:24 -08:00
Jimmy Tang 19ba54c9fd Don't be fatal on import errors so plays don't fail if plugin doesn't have required dependencies 2015-11-14 20:02:03 +00:00
Jimmy Tang 125370ab48 Run when whitelisted 2015-11-14 19:46:00 +00:00
Jimmy Tang 5f2f5e2b59 Add boilerplate and fix initialisation to match what 2.0 expects 2015-11-14 08:54:41 +00:00
Jimmy Tang c02ceb8f12 Remove threading and queues. Added license information and cleaned up callback. 2015-11-14 08:40:16 +00:00
Jimmy Tang 85277c8aae Initial add of logentries callback plugin
This callback plugin will generate json objects to be sent to the
logentries service for auditing/debugging purposes.

To use:

Add this to your ansible.cfg file in the defaults block

    [defaults]
    callback_plugins = ./callback_plugins
    callback_stdout = logentries
    callback_whitelist = logentries

Copy the callback plugin into the callback_plugings directory

Either set the environment variables

    export LOGENTRIES_API=data.logentries.com
    export LOGENTRIES_PORT=10000
    export LOGENTRIES_ANSIBLE_TOKEN=dd21fc88-f00a-43ff-b977-e3a4233c53af

Or create a logentries.ini config file that sites next to the plugin with the following contents

    [logentries]
    api = data.logentries.com
    port = 10000
    tls_port = 20000
    use_tls = no
    token = dd21fc88-f00a-43ff-b977-e3a4233c53af
2015-11-14 08:40:16 +00:00
Toshio Kuratomi 62979efa14 Finish up plugin porting to global display
Also remove display = display which does nothing
2015-11-11 10:44:23 -08:00
James Cammarata a99f2fd52f Save delegated vars in result for use in callback methods
Fixes #13014
2015-11-10 10:14:30 -05:00
Brian Coca e2c56efca6 Merge pull request #12867 from bcoca/callback_whitelist_tweak
make callbacks declare needing whitelisting
2015-11-05 12:58:05 -05:00
Toshio Kuratomi 658ea053ea Cleanup timer callback plugin's overwriting of modules it imported 2015-11-03 09:53:18 -08:00
Brian Coca 467c29e3db show task path on 2 vs 2015-11-01 17:43:11 -05:00
Brian Coca 7ba4f5ee12 removed no_log redundant code 2015-10-30 14:01:47 -04:00
Brian Coca b97887ba41 simplified invocation removal, added no_log awareness 2015-10-30 10:17:19 -04:00
Brian Coca 8ce864db6f sanatize results 2015-10-24 15:23:12 -04:00
Toshio Kuratomi 92dd563a75 Fix invocation from bad merge and note where it would need to go to keep
it out of registered vars as well.
2015-10-24 07:29:42 -07:00
Brian Coca 25e3fe04a8 finalized changed to use abridtged_result instead of result
removed no longer defined no_log
2015-10-23 23:10:57 -04:00
Toshio Kuratomi 3812ec8d1d Implement invocation hiding for all callbacks if the verbosity is low 2015-10-23 11:11:34 -07:00
Brian Coca 275764d4a5 avoid showing invokation when no_log is set or verbosity is low 2015-10-23 14:06:20 -04:00
Toshio Kuratomi 99c6f77e59 Fix callback 2015-10-23 09:15:22 -07:00
Toshio Kuratomi ce2b18174e Merge pull request #12878 from ansible/invocation-fix
Invocation fix
2015-10-22 16:17:40 -07:00
Toshio Kuratomi 2e87c1f74e Two fixes to action plugins
* Fix the task_vars parameter to not default to a mutable type (dict)
* Implement invocation in the base class's run() method have each action
  module call the run() method's implemention in the base class.
* Return values from the action plugins' run() method takes the return
  value from the base class run() method into account so that invocation
  makes its way to the output.

Fixes #12869
2015-10-22 16:07:26 -07:00
Brian Coca 5017a96948 Revert "make callbacks declare needing whitelisting"
another premature merge
This reverts commit df8ff85787.
2015-10-22 16:34:51 -04:00
James Cammarata 86de1429e5 Cleaning up FIXMEs 2015-10-22 16:03:50 -04:00
Brian Coca df8ff85787 make callbacks declare needing whitelisting
this will allow for custom or v1 callbacks locally loaded to automatically be triggered as they were in 1.x
2015-10-22 12:30:23 -04:00
Toshio Kuratomi 6b6d03290a Restore the automatic addition of invocation to the output
Revert "Remove auto-added invocation return value as it is not used by v2 and could leak sensitive data."

This reverts commit 6ce6b20268.

Remove the note that invocation was removed as we've now restored it.

Revert "keyword not in ubuntu 14.04"

This reverts commit 5c01622457.

Revert "remove invocation keyword check"

This reverts commit 5177cb3f74.
2015-10-22 08:53:37 -07:00
Brian Coca c267c23020 make callbacks declare needing whitelisting
this will allow for custom or v1 callbacks locally loaded to automatically be triggered as they were in 1.x
2015-10-22 08:27:32 -04:00
Toshio Kuratomi f34b55ac2b Add python3-compat boilerplate to all .py files in lib/ansible 2015-10-19 18:36:19 -07:00
James Cammarata e5b6d802bf Removing some cruft related to _local_action value on Task, which was removed
Fixes #12819
2015-10-19 16:52:27 -04:00
James Cammarata 1cfd941179 Adding a v2 callback for task includes 2015-10-19 13:42:17 -04:00
Toshio Kuratomi 6ce6b20268 Remove auto-added invocation return value as it is not used by v2 and could leak sensitive data. 2015-10-19 09:08:25 -07:00
Brian Coca 2d1d21228a updated skippy to match default output 2015-10-18 11:00:50 -04:00
Brian Coca 6c8cf8acb7 now profile_tasks callback handles handlers correctly
fixes #12762
2015-10-16 18:01:27 -04:00
Toshio Kuratomi baa309309d Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 2015-10-16 08:21:28 -07:00
Brian Coca 45788fbfad <homer>doh!</homer> 2015-10-09 16:58:01 -04:00
Brian Coca b9d54e9a01 corrects previous fix to deal with missing item key in results dict 2015-10-09 13:01:32 -04:00
Brian Coca fbf4cafab5 on skipped you 'might' not have an item, changed to getattr to avoid keyerror
fixes #12683
2015-10-09 11:28:11 -04:00
James Cammarata 770032648a Show -> localhost for local_action tasks 2015-10-09 10:53:53 -04:00
Brian Coca dac3684fd1 changed task color to dark gray to keep it from being confused with ignore/skip 2015-10-07 12:12:35 -04:00
Juraci e52950a939 Displaying task_path on task start when verbosity is more than 3 2015-10-07 10:11:50 -03:00
James Cammarata 9e364c2eb5 Don't modify results in callbacks
Fixes #12654
2015-10-06 21:43:43 -04:00
James Cammarata 38528c8ef3 Show more info in the minimal callback for unreachable hosts
Fixes #12621
2015-10-03 01:41:57 -04:00
Brian Coca e2ae3215f6 corrected no_log for items and skipped tasks
corrected output from default callback
added new tests for no_log loops
updated makefile test to check for both positive and negative occurrences of no_log
2015-10-02 14:35:33 -04:00
Brian Coca 4c9f58a152 added no_log censoring to item output
should be last commit that fixes #12214
2015-10-02 09:11:41 -04:00
Brian Coca 6b842d9c49 fixed incorrect data passing on certain events 2015-10-01 18:49:51 -04:00
Brian Coca 6e96188085 added missing entry for dealing with bcc 2015-10-01 18:49:51 -04:00
James Cammarata eb8d7dcd14 Make sure formatted strings don't bomb on tuples
Fixes #12501
2015-09-25 03:01:42 -04:00
Toshio Kuratomi 5d3d9cfe0d Convert to byte strings to avoid UnicodeErrors
Fixes #12488
2015-09-23 15:24:17 -07:00
James Cammarata c30e464388 Additional tweaks to callback output for delegate_to 2015-09-22 09:25:38 -04:00
James Cammarata 513619867a Show delegated-to host in callback message
Fixes #12465
2015-09-22 08:45:04 -04:00
Toshio Kuratomi 3db8070aa3 Fix urlopen usage to use open_url instead
Add a travis test for urlopen usage
2015-09-16 20:40:17 -07:00
Brian Coca 9d4d7bd74d fixed porting bugs in profile_tasks to v2 2015-09-11 16:48:09 -04:00
Brian Coca 6b73cac35a corrected skipped_hosts constant usage, thanks @benjixx 2015-08-30 20:21:15 -04:00
James Cammarata f0257683b0 Fixed missing constants import in default callback
Fixes #12145
2015-08-28 16:54:56 -04:00
Brian Coca b6c6ed91fe implemented not showing skipped hosts config 2015-08-28 12:32:50 -04:00
Brian Coca 861fdfc5ba updated callbacks to properly test diff no matter if dict or list 2015-08-16 02:37:21 -04:00
Brian Coca c3372936aa diff can now be a list 2015-08-16 02:37:21 -04:00
Brian Coca e46b1e8d2b adjusted tree to work more like v1, also now skips when dir not supplied 2015-08-12 10:35:49 -04:00
Brian Coca 4d853a5d3c implemented for v2, missing --tree option for adhoc 2015-08-11 19:18:10 -04:00
James Cammarata 169d316704 Fixing bugs in include + loops
Fixes #11872
2015-08-11 01:33:43 -04:00
Brian Coca 113f709eac brought up to date with default 2015-07-30 16:53:38 -04:00
Brian Coca a8b2b5b0c9 avoids printing blank diffs
fixes #10147 fixes #9471
2015-07-28 15:47:52 -04:00
Brian Coca f4a997db49 added back but stderr, which was the original itnention 2015-07-28 14:36:06 -04:00
Brian Coca 3b9282fb90 fixed dupe output in raw/command cases 2015-07-28 14:31:49 -04:00
Brian Coca 6cdee94c33 added missing skipped item function to base 2015-07-28 11:02:25 -04:00
Brian Coca 6f93d228f6 made item output closer to v1 2015-07-28 10:59:39 -04:00
Brian Coca 4f9d719b14 removed debug 2015-07-28 10:43:11 -04:00
Brian Coca d78c2fc212 now reports per task item 2015-07-28 10:41:40 -04:00
Brian Coca 787a0c4e04 fixed indent issues 2015-07-28 10:10:21 -04:00
Brian Coca 5f8db9cd4b changed verbose_override to the new _ansible_verbose_override to keep in line with previous changes
output now defaults back to having indent=4
2015-07-27 22:15:44 -04:00
James Cammarata cb262449c7 Reworking internal result flags and making sure include_vars hides vault data
Fixes #10194
2015-07-27 14:04:31 -04:00
Brian Coca a56ff7ae54 now it really is oneline 2015-07-26 23:14:07 -04:00
Brian Coca 5d1d9f1505 fixed diff output to be as it was in 1.x, copy and template now use the same
functions to do difs.
2015-07-26 22:29:56 -04:00
Brian Coca 0b6fadaad7 started implementing diff
diff now works with template
also fixed check mode for template and copy
2015-07-26 12:22:22 -04:00
Brian Coca a6ba149c49 implemented simplified output for adhoc adn command modules as in v1 2015-07-23 13:42:20 -04:00
James Cammarata e64989beb4 Moving ConnectionInformation -> PlayContext
Also making PlayContext a child class of the Playbook Base class,
which gives it access to all of the FieldAttribute code to ensure
field values are correctly typed after post_validation

Fixes #11381
2015-07-21 12:13:50 -04:00
Pierre-Louis Bonicoli fda8fa77ab Fix pyflakes error: use 'msg' variable
Error was: local variable 'msg' is assigned to but never used
2015-07-20 12:41:39 +02:00
Brian Coca a09ce4bd87 added callback that skipts 'skipped' 2015-07-19 23:55:39 -04:00
Brian Coca 1aa4155266 generalized warning handling, added it to adhoc also 2015-07-17 14:14:15 -04:00
James Cammarata d4ac73a1bc Adding back capability to display warnings contained in results
Fixes #11255
2015-07-17 13:44:22 -04:00
Gerard Lynch a6c8d30f3e callbacks require a version constant or the v2 code doesn't pass the display param and it gives an error 2015-07-17 15:33:48 +01:00
Brian Coca a09f6236a5 adapated to v2 2015-07-17 08:55:22 -04:00
Brian Coca 10e5c2b46d fixed var scope 2015-07-17 08:54:28 -04:00
Tom Paine 097ed1f17b Add plugin that profiles playbook tasks
Resubmission of https://github.com/ansible/ansible/pull/11270 to
correct v2 file location.

[Description and console output
demonstration](https://github.com/aioue/ansible-plugin-profile/blob/mast
er/README.md#features).

Provides per-task timing, ongoing playbook elapsed time and ordered
list of top 20 longest running tasks at end.
2015-07-17 13:04:31 +01:00
Brian Coca b76cb8f655 now that invocation is only async again, no need to sanitize 2015-07-15 10:40:37 -04:00
James Cammarata 6971e92f39 Fixing up some output stuff 2015-07-14 00:23:17 -04:00
Brian Coca c4b6d91275 added skipped to oneline 2015-07-13 15:54:12 -04:00
Brian Coca 8ad52c2e4f readded oneline output feature to adhoc
fixes #11573
2015-07-13 15:43:31 -04:00