0
votes

Installed AWX docker from here - https://github.com/ansible/awx. I am trying to add a callback-plugin for a specific project as written here - https://docs.ansible.com/ansible-tower/latest/html/administration/tipsandtricks.html#using-callback-plugins-with-tower. Does not work. I add to Template-> EXTRA VARIABLES lines

---
bin_ansible_callbacks: true
callback_plugins: /callback_plugins
stdout_callback: selective

Does not work.

I add the directory /var/lib/awx/projects/test/callback_plugins/ to SETTINGS-> JOBS-> ANSIBLE CALLBACK PLUGINS - it doesn't work either.

Tell me, please, how to do it correctly, so that another (custom) plugin picks up and earns.

1
I think your issue might have been casing and/or using an absolute path instead of a relative one, maybe try CALLBACK_PLUGINS: callback_plugins instead - Ben

1 Answers

0
votes

I'm issuing the same problem, after some debugs the problem I've open a issue on AWX project https://github.com/ansible/awx/issues/4149

In the meantime I've applied a workaround that consists in create a symlinks for each callback plugin you want to use in the callback_plugins folder of your roles project

For example, if you are using the ara project

    - name: Research for callbacks in virtualenv libs
      find:
        path: '{{ ansible_playbook_python|dirname|dirname }}/{{ item }}'
        file_type: file
        depth: 1
        patterns: '*.py'
        excludes: '__init__*'
      register: _internal__callbacks
      with_items:
        - lib/python3.6/site-packages/ara/plugins/callbacks

# TODO : prevent existing callbacks to be overwritten

    - name: Create symlinks from virtualenv lib directory to local callback_plugins/
      file:
        src: '{{ item }}'
        dest: '{{ playbook_dir }}/callback_plugins/{{ item|basename }}'
        state: link
      with_items: "{{ _internal__callbacks.results|map(attribute='files')|flatten|map(attribute='path')|list }}"