Commit Graph

448 Commits (1b4fd23ba6dab52a395278e3ef7ca994e0819d60)

Author SHA1 Message Date
Abhijeet Kasurde 4885ebad27
default_callback: Move 'check_mode_markers' in doc_fragments (#70228)
Callback plugin dense, yaml, and debug implement 'check_mode_markers'
so moving documentation to default callback doc_fragments.

Fixes: https://github.com/ansible-collections/community.general/issues/565

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
4 years ago
Rick Elrod 7584e145a9
Nuke _get_item() from callback, deprecated 2.11 (#70233)
Change:
- Remove _get_item() alias as it has been deprecated
- Update tests
- Remove relevant sanity curtailment
- Add changelog

Test Plan:
CI, grep

Signed-off-by: Rick Elrod <rick@elrod.me>
4 years ago
Matt Clay 9f49db1f99 Avoid use of deprecated junit-xml method. 4 years ago
Matt Martz aff6b1ff21
Address linting errors in default callback (#69989) 4 years ago
Brian Coca 805dff4129
fixed missing default (#69972)
* fixed missing default

 also deprecated so new options wont have to go through this
4 years ago
Felix Fontein a862ff2d43
Deprecation revisited (#69926)
* Allow to specify collection_name separately for deprecation.

* Use new functionality in Ansible.

* Use new functionality in tests.

* Update tagging/untagging functions.

* Update pylint deprecated sanity test.

* Update validate-modules. Missing are basic checks for version_added (validate semantic version format for collections).

* Improve version validation. Re-add version_added validation.

* Make sure collection names are added to return docs before schema validation.

* Extra checks to avoid crashes on bad data.

* Make C# module utils code work, and update/extend tests.

* Add changelog fragment.

* Stop extracting collection name from potentially tagged versions/dates.

* Simplify C# code.

* Update Windows modules docs.

* Forgot semicolons.
4 years ago
Felix Fontein 40f21dfd3c
Version source tagging (automatic and manual) for version_added and deprecation versions (#69680)
* Track collection for version_added.
Validate *all* version numbers in validate-modules.
For tagged version numbers (i.e. version_added), consider source collection to chose validation.

* Make tagging/untagging functions more flexible.

* Tag all versions in doc fragments.

* Tag all deprecation versions issued by code.

* Make Display.deprecated() understand tagged versions.

* Extend validation to enforce tagged version numbers.

* Tag versions in tests.

* Lint and fix test.

* Mention collection name in collection loader's deprecation/removal messages.

* Fix error IDs.

* Handle tagged dates in Display.deprecated().

* Also require that removed_at_date and deprecated_aliases.date are tagged.

* Also automatically tag/untag removed_at_date; fix sanity module removal version check.

* Improve error message when invalid version number is used (like '2.14' in collections).
4 years ago
Matt Martz d86d20a378
Fix label lookup in the default callback for includes (#68822)
* Replace included_file._args w/ included_file._vars

* Fix item value in output of include_tasks loop

Signed-off-by: Yadnyawalk Tale <ytale@redhat.com>

* Update tests for loop callback fix. Add changelog

Co-authored-by: Yadnyawalk Tale <ytale@redhat.com>

Fixes #65904
Fixes #66018
5 years ago
Ansible Core Team 0743e733bb Migrated to theforeman.foreman 5 years ago
Ansible Core Team 829eb0f1d1 Migrated to ansible.posix 5 years ago
Ansible Core Team 6d910034a0 Migrated to ansible.amazon 5 years ago
Ansible Core Team 43f47d553e Migrated to community.grafana 5 years ago
Ansible Core Team 4e488d8435 Migrated to community.general 5 years ago
Abhijeet Kasurde b3381704e3
Misc documentation fixes (#67863)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Mads Jensen f978b6c789
Use https for Ansible Slack icon. (#65625) 5 years ago
Tomer Brisker a4f5c2e993
Post reports to newer Foreman API endpoint (#64955)
The `/api/v2/reports` endpoint has been deprecated a long time ago and should
no longer be used. This changes to callback to use the correct API
endpoint and paramerter.
5 years ago
akatch 936bd83614
Fix duplicate log entries (and add item support for failures) (#66098) 5 years ago
Abhijeet Kasurde 9a13d56b26
Misc typo fixes (#66120)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Abhijeet Kasurde e82b28a920
cgroup_perf_recap: Check if user wants to write to files or not (#64988)
if user sets 'write_files' to False or does not set value, then
handle file write related operations.

Fixes: #64936

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
Patrick O'Brien c76e074e4c Callback: removing args from task_fields from Sumologic and Splunk plugin(#63527)
CVE-2019-14864 Ansible: Splunk and Sumologic callback plugins leak sensitive data in logs

Fixes #63522

Signed-off-by: Patrick O’Brien <patrick.obrien@thetradedesk.com>
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
5 years ago
emschu 9d91e6275e enable grafana_annotations callback sending annotations to multiple panels (#57575)
* enable grafana_annotations callback plugin message sending to multiple panels

* remove new line at end of file

* restructuring code of grafana_annotations cb plugin

* add missing self keyword

* grafana callback: use list for panel_ids

* grafana callback: convert panel_id to integer

annotations HTTP API states that panelId are integer (same as
dashboardId which is also converted).
5 years ago
James Cassell bfd32c9b00 clean "changed" only after it has been processed (#59958)
* clean "changed" after it has been processed

without this change, a loop of `debug` tasks with `changed_when`
causes the "changed" status to get lost before output

* runme.sh tests for debug loop status
5 years ago
Evgeni Golov 8d0c193b25 allow before/after diff to be NoneType (#62582)
when creating or deleting an object (e.g. via an API), before/after can
be `None` (or at least represented as such by the used library). to
avoid modules havig to do

    diff={'before': before or '', 'after': after or ''}

let's just convert `None` to an empty string that can be diffed properly
5 years ago
Matt Martz df6b8d2a4a
Fix async output with adhoc callbacks. Fixes #15988 (#59935) 5 years ago
basos g 3c8838f0f7 Add check mode indicators at the beginning and the end of the playbook, play, and task (#49432)
* Add integration tests for default callback check mode markers
5 years ago
Matt Martz 284dafe476
Perfy McPerferton (#58400)
* InventoryManager start of perf improvements

* 0 not 1

* More startswith to [0] improvements

* Remove unused var

* The hash doesn't need to be a string, start as a list, make it into a tuple

* set actually appears faster than frozenset, and these don't need to be frozen

* Cache hosts lists, to avoid extra get_hosts calls, pass to get_vars too

* negligible perf improvement, it could help with memory later

* Try the fast way, fallback to the safe way

* Revert to previous logic, linting fix

* Extend pre-caching to free

* Address test failures

* Hosts are strings

* Fix unit test

* host is a string

* update test assumption

* drop SharedPluginLoaderObj, pre-create a set, instead of 2 comparisons in the list comprehension

* Dedupe code

* Change to _hosts and _hosts_all in get_vars

* Add backwards compat for strategies that don't do set host caches

* Add deprecation message to SharedPluginLoaderObj

* Remove unused SharedPluginLoaderObj import

* Update docs/comments

* Remove debugging

* Indicate what patterh_hash is

* That won't work

* Re-fix tests

* Update _set_hosts_cache to accept the play directly, use without refresh in get_hosts_remaining and get_failed_hosts for backwards compat

* Rename variable to avoid confusion

* On add_host only manipulate _hosts_cache_all

* Add warning docs around _hosts and _hosts_all args
5 years ago
Rémi REY b6273e91cf Fix deprecation warning message from grafana_annotations
The Display class has no `info` attribute/method. The use of the method
was raising an Exception in task_queue_manager and displayed an
unappropriate deprecation warning.
5 years ago
jpic 945e35ada2 Fix exception in unixy callback v2_runner_retry (#58801) 5 years ago
Brian Goad 23fcae7c9e Fix issue with displaying error about unreachable hosts when using Unixy Callback (#58076) 5 years ago
akatch 200eed6177 Implement display_ok_hosts and display_skipped_hosts for unixy (#53179)
* Implement display_ok_hosts and display_skipped_hosts like default callback

* Implement show_custom_stats and display_failed_stderr like default callback

* Fix pep8

* Clarify conditional

* Changelog fragment

* Import from defaults.py per feedback
5 years ago
Kerwin Bryant 95882faca6 Optimize the code for the callback module (#56827)
* Optimize the code for the callback module

* fix pep error

* Restore incorrectly submitted code

* fix pep error

* fix pep error

* Restore incorrectly submitted code

* Restore incorrectly submitted code

* fix condition

* fix condition

* fix pep error
5 years ago
Paddy Newman 2ef7759be1 Allow syslog_json callback options to be set in an Ansible configurat… (#57232)
* Allow syslog_json callback options to be set in an Ansible configuration file.

The syslog_json documentation says that it supports options via an Ansible
configuration file. In fact, they can only be specified via environment
variables.

I've updated the module to use the standard "get_options" handling which means
that it can now support options via environment variables *or* the
configuration file.

Options can be set in the configuration file as follows:

```
callback_whitelist = syslog_json

[callback_syslog_json]
syslog_server = localhost
syslog_port = 514
syslog_facility = user
```

* Use the original, documented, names for the modules options.

In the documentation text change syslog_server to server, syslog_port to port
and syslog_facility to facility.

* Add an item to the changelog.

* Update 57232-syslog-json-configuration-options.yml

Fix a YAML syntax error / typo.
5 years ago
Brian Coca eb9009c4f4 added missing version_added 5 years ago
Paddy Newman 57e42842b0 Add a new "log_folder" option to the log_plays callback plugin. (#56717)
* Add a new "log_folder" option to the log_plays callback plugin.

A a new option for the log_plays callback plugin which allows the user to
control where the callback where creates log files.

The option can be set via the ANSIBLE_LOG_FOLDER environment variable or in the
Ansible configuration file, e.g.:

[callback_log_plays]
log_folder = /path/to/my/log/folder
5 years ago
Matt Martz 867e357eb1
When not using file_per_task, make sure we don't prematurely close the perf files (#56477)
* When not using file_per_task, make sure we don't prematurely close the perf files

* add changelog fragment
5 years ago
Brian Coca 9f87552f06
add option to display per host start to default (#53819)
* add option to display per host start to default
6 years ago
Andrew Gaffney 94154c5f4d Only show a task banner if a diff is found (#55050) 6 years ago
Jim Ladd 17d78553ee Add options for configuring memory / pid polling interval (#54936) 6 years ago
James Cassell bc4ef99533 standardize TLS connection properties (#54315)
* openstack: standardize tls params

* tower: tower_verify_ssl->validate_certs

* docker: use standard tls config params

- cacert_path -> ca_cert
- cert_path -> client_cert
- key_path -> client_key
- tls_verify -> validate_certs

* k8s: standardize tls connection params

- verify_ssl -> validate_certs
- ssl_ca_cert -> ca_cert
- cert_file -> client_cert
- key_file -> client_key

* ingate: verify_ssl -> validate_certs

* manageiq: standardize tls params

- verify_ssl -> validate_certs
- ca_bundle_path -> ca_cert

* mysql: standardize tls params

- ssl_ca -> ca_cert
- ssl_cert -> client_cert
- ssl_key -> client_key

* nios: ssl_verify -> validate_certs

* postgresql: ssl_rootcert -> ca_cert

* rabbitmq: standardize tls params

- cacert -> ca_cert
- cert -> client_cert
- key -> client_key

* rackspace: verify_ssl -> validate_certs

* vca: verify_certs -> validate_certs

* kubevirt_cdi_upload: upload_host_verify_ssl -> upload_host_validate_certs

* lxd: standardize tls params

- key_file -> client_key
- cert_file -> client_cert

* get_certificate: ca_certs -> ca_cert

* get_certificate.py: clarify one or more certs in a file

Co-Authored-By: jamescassell <code@james.cassell.me>

* zabbix: tls_issuer -> ca_cert

* bigip_device_auth_ldap: standardize tls params

- ssl_check_peer -> validate_certs
- ssl_client_cert -> client_cert
- ssl_client_key -> client_key
- ssl_ca_cert -> ca_cert

* vdirect: vdirect_validate_certs -> validate_certs

* mqtt: standardize tls params

- ca_certs -> ca_cert
- certfile -> client_cert
- keyfile -> client_key

* pulp_repo: standardize tls params

remove `importer_ssl` prefix

* rhn_register: sslcacert -> ca_cert

* yum_repository: standardize tls params

The fix for yum_repository is not straightforward since this module is
only a thin wrapper for the underlying commands and config.  In this
case, we add the new values as aliases, keeping the old as primary,
only due to the internal structure of the module.

Aliases added:
- sslcacert -> ca_cert
- sslclientcert -> client_cert
- sslclientkey -> client_key
- sslverify -> validate_certs

* gitlab_hook: enable_ssl_verification -> hook_validate_certs

* Adjust arguments for docker_swarm inventory plugin.

* foreman callback: standardize tls params

- ssl_cert -> client_cert
- ssl_key -> client_key

* grafana_annotations: validate_grafana_certs -> validate_certs

* nrdp callback: validate_nrdp_certs -> validate_certs

* kubectl connection: standardize tls params

- kubectl_cert_file -> client_cert
- kubectl_key_file -> client_key
- kubectl_ssl_ca_cert -> ca_cert
- kubectl_verify_ssl -> validate_certs

* oc connection: standardize tls params

- oc_cert_file -> client_cert
- oc_key_file -> client_key
- oc_ssl_ca_cert -> ca_cert
- oc_verify_ssl -> validate_certs

* psrp connection: cert_trust_path -> ca_cert

TODO: cert_validation -> validate_certs (multi-valued vs bool)

* k8s inventory: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* openshift inventory: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* tower inventory: verify_ssl -> validate_certs

* hashi_vault lookup: cacert -> ca_cert

* k8s lookup: standardize tls params

- cert_file -> client_cert
- key_file -> client_key
- ca_cert -> ca_cert
- verify_ssl -> validate_certs

* laps_passord lookup: cacert_file -> ca_cert

* changelog for TLS parameter standardization
6 years ago
James Cassell 51f2065df5 use ANSIBLE_ prefix on all ansible-defined env vars (#54272)
mark old version deprecated in all places referenced via docs
6 years ago
Matt Martz 231f3e138a
Close files before opening new ones (#53961) 6 years ago
Sloane Hertel 7da565b3ae
parse botocore.endpoint logs into a list of AWS actions (#49312)
* Add an option to parse botocore.endpoint logs for the AWS actions performed during a task

Add a callback to consolidate all AWS actions used by modules

Added some documentation to the AWS guidelines

* Enable aws_resource_actions callback only for AWS tests

* Add script to help generate policies

* Set debug_botocore_endpoint_logs via environment variable for all AWS integration tests

Ensure AWS tests inherit environment

(also remove AWS CLI in aws_rds inventory tests and use the module)
6 years ago
Brian Coca b793f08a92
fixes for stripping (#52930)
function changed to do in place replacement, should be less expensive even with copy as it avoids 'sub copies', can compose with module_args_copy to create replacement for old behavior

  attempt to fix #52910

* handle lists and subdicts correctly
* added  missing exception case, which was not noticed since 'cleaning' was not working
* added comments to clarify exceptions
6 years ago
Abhijeet Kasurde 917520d560 Misc typo fixes (#53284)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
6 years ago
Martin Krizek 66eb301cd3 profile_tasks: Fix last task time with multiple plays (#53065) 6 years ago
Pilou d8a2d64ec1 osx_say callback plugin: add espeak support, rename to say (#33740)
* rename into say

* add support for espeak command

* adds symlink from osx_say to say

* Update version number
6 years ago
Jonathan Brown 681082e47c Unixy stdout callback: Display name of play and list of play hosts, don't display play name if no hosts in play (#32810) 6 years ago
Andrew Gaffney e287b35f69 Turn 'actionable' into a thin wrapper for 'default' (#52908)
The 'default' action plugin now implements this functionality, so the
'actionable' plugin doesn't need any of its own logic (which was
interacting poorly with the new 'default' plugin logic to do the same
things). This fixes #51533 and #47353
6 years ago
Matt Martz 269cdffcea
Format dict keys need to be bytes (#52728) 6 years ago
Martin Krizek be9f07279e Add stats on rescued/ignored tasks (#48418)
* Adding rescued/ignored tasks to stats gathering

Fixes #31245

* Amend integration tests to pass

* callback/dense.py: fix too-many-format-args

* Add changelog

* Amend counter_enabled and unixy callbacks

* Fix syntax error

* Fix typo in the changelog

* Remove not needed comment

* Re-add skipped

* Add test for rescued

* Fix colors...

* Fix unstable tests?

* Add a note to the porting guide

* Re-word the note in the porting guide

Fixes #20346
Fixes #24525
Fixes #14393

Co-authored-by: James Cammarata <jimi@sngx.net>
Co-authored-by: Martin Krizek <martin.krizek@gmail.com>
6 years ago