Skip to content

datadog_callback.py callback plugin implements deprecated method(s) #82

@yamjoepobuda

Description

@yamjoepobuda

The following message has started appearing in Ansible 12.x

Ansible [DEPRECATION WARNING] events have been detected. Message: [DEPRECATION WARNING]: The '/etc/ansible/playbooks/callback_plugins/datadog_callback.py' callback plugin implements the following deprecated method(s): playbook_on_stats, runner_on_failed, runner_on_ok, runner_on_unreachable. This feature will be removed from the callback plugin API in ansible-core version 2.23. Implement the `v2_*` equivalent callback method(s) instead. Playbook: ansible/playbook/windows/validation

Additionally, some plays are failing to start due to the callback plugin. Removing the Datadog callback plugin from the playbooks folder resolves the error.

 [WARNING]: Deprecation warnings can be disabled by setting `deprecation_warnings=False` in ansible.cfg.
 [DEPRECATION WARNING]: Passing `disable_lookups` to `template` is deprecated. This feature will be removed from ansible-core version 2.23.
 [DEPRECATION WARNING]: The '/etc/ansible/playbooks/yam-shared/callback_plugins/datadog_callback.py' callback plugin implements the following deprecated method(s): playbook_on_stats, runner_on_failed, runner_on_ok, runner_on_unreachable. This feature will be removed from the callback plugin API in ansible-core version 2.23. Implement the `v2_*` equivalent callback method(s) instead.
 [ERROR]: Unexpected Exception, this is probably a bug: 'CallbackModule' object has no attribute 'wants_implicit_tasks'
 
 Traceback (most recent call last):
   File "/usr/local/lib/python3.12/site-packages/ansible/cli/__init__.py", line 660, in cli_executor
     exit_code = cli.run()
                 ^^^^^^^^^
   File "/usr/local/lib/python3.12/site-packages/ansible/cli/playbook.py", line 153, in run
     results = pbex.run()
               ^^^^^^^^^^
   File "/usr/local/lib/python3.12/site-packages/ansible/executor/playbook_executor.py", line 118, in run
     self._tqm.send_callback('v2_playbook_on_start', pb)
   File "/usr/local/lib/python3.12/site-packages/ansible/utils/lock.py", line 39, in inner
     return func(*args, **kwargs)
            ^^^^^^^^^^^^^^^^^^^^^
   File "/usr/local/lib/python3.12/site-packages/ansible/executor/task_queue_manager.py", line 472, in send_callback
     if not callback_plugin.wants_implicit_tasks and (task_arg := self._first_arg_of_type(Task, args)) and task_arg.implicit:
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 AttributeError: 'CallbackModule' object has no attribute 'wants_implicit_tasks'
 
 The above exception was the direct cause of the following exception:
 
 Traceback (most recent call last):
   File "/usr/local/lib/python3.12/site-packages/ansible/cli/__init__.py", line 669, in cli_executor
     raise AnsibleError("Unexpected Exception, this is probably a bug.") from ex
 ansible.errors.AnsibleError: Unexpected Exception, this is probably a bug: 'CallbackModule' object has no attribute 'wants_implicit_tasks'

Environment

 + ansible --version
 ansible [core 2.18.11]
   config file = /etc/ansible/ansible.cfg
   configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
   ansible python module location = /usr/local/lib/python3.12/site-packages/ansible
   ansible collection location = /usr/share/ansible/collections
   executable location = /usr/local/bin/ansible
   python version = 3.12.12 (main, Oct  9 2025, 22:34:22) [GCC 14.2.0] (/usr/local/bin/python3.12)
   jinja version = 3.1.6
   libyaml = True

 + ansible-config dump --only-changed
 ANSIBLE_NOCOWS(/etc/ansible/ansible.cfg) = True
 ANSIBLE_PIPELINING(/etc/ansible/ansible.cfg) = True
 COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/usr/share/ansible/collections']
 CONFIG_FILE() = /etc/ansible/ansible.cfg
 DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 50
 DEFAULT_POLL_INTERVAL(/etc/ansible/ansible.cfg) = 5
 DEFAULT_REMOTE_USER(/etc/ansible/ansible.cfg) = ansible
 DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/etc/ansible/roles']
 DEFAULT_TIMEOUT(/etc/ansible/ansible.cfg) = 20
 DISPLAY_SKIPPED_HOSTS(/etc/ansible/ansible.cfg) = False
 HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
 INTERPRETER_PYTHON(/etc/ansible/ansible.cfg) = auto_silent
 PERSISTENT_COMMAND_TIMEOUT(/etc/ansible/ansible.cfg) = 30
 PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 40
 RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False

 + uname -a
 Linux 648946539c01 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64 Linux
 + cat /etc/os-release
 NAME="Alpine Linux"
 ID=alpine
 VERSION_ID=3.22.2
 PRETTY_NAME="Alpine Linux v3.22"
 HOME_URL="https://alpinelinux.org/"
 BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions