In the documentation it shows:
playbook_on_include_msg:
Output to be used for callback playbook_on_include.
Configuration:
INI entry:
[callback_diy]
playbook_on_include_msg = None
And the community.general.diy callback documentation it states:
Condition for all msg options: if value is None or omit, then the option is not being used. Effect: use of the default callback plugin for output
Condition for all msg options: if value is not None and not omit and length is not greater than 0, then the option is being used without output. Effect: suppress output
Condition for all msg options: if value is not None and not omit and length is greater than 0, then the option is being used with output. Effect: render value as template and output
Statement #2 and #3 work as expected. But option #1 does not. It in fact just prints the string 'None' or 'omit'.
I believe that you would need to use "{{ None }}" or "{{ omit }}".
---
- hosts: localhost
gather_facts: no
tasks:
- ansible.builtin.include_tasks: diy_test_include.yml
diy_test_include.yml:
---
- name: In test_diy_include.yml
ansible.builtin.debug:
msg: "Test debug message"
Playbook run:
$ ansible-playbook diy_test.yml
[WARNING]: No inventory was parsed, only implicit localhost is available
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
PLAY [localhost] *****************************************************************************************************************************************************
TASK [ansible.builtin.include_tasks] *********************************************************************************************************************************
None
TASK [In test_diy_include.yml] ***************************************************************************************************************************************
ok: [localhost] => {
"msg": "Test debug message"
}
PLAY RECAP ***********************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Summary
In the documentation it shows: playbook_on_include_msg: Output to be used for callback playbook_on_include. Configuration: INI entry: [callback_diy] playbook_on_include_msg = None
And the community.general.diy callback documentation it states:
Statement #2 and #3 work as expected. But option #1 does not. It in fact just prints the string 'None' or 'omit'. I believe that you would need to use "{{ None }}" or "{{ omit }}".
Issue Type
Documentation Report
Component Name
community.general.diy
Ansible Version
Community.general Version
Configuration
OS / Environment
Oracle Linux Server 8.6
Additional Information
ansible.cfg:
diy_test.yml:
diy_test_include.yml:
Playbook run:
Code of Conduct