Subclassing ansible.utils.display.Display in custom callback plugin

Hi all,

please allow me to ask for any help here…
I once wrote a custom callback plugin, where I subclassed ansible.utils.display.Display so I could overrule it’s display() method to manipulate the message to be printed, and then call super(Display, self).display(…
Since Ansible 2.8 the Display object is now a singleton, instantiated right at ‘ansible-playbook’. This means a cannot modify the Display.display() anymore right ?

Any ideas on how to call a customized display() method ?

Thanks in advance for any help.

Pieter.

To answer myself… I figured this simple solution :

in ‘init()’

self.realdisplay = self._display.display
self._display.display = self.display

then add a ‘display()’ method that intercept my message, and then calls ‘self.realdisplay()’

Gonna run some tests now. Thanks for your time so far…

Pieter

Hi peter,

if you don’t mind please send me output, i would like to get something like below

Hi ,

excuse me, but I don’t get the question here… How can I help you ?

Hi Pieter,

sorry for the confus,

i would like to see output like below:

Socket Locator | Status | Size | Max Supported Frequency | Technology |

  • | - | - | - | - |
    PROC 1 DIMM 3 | Good, In Use | 32.00 GB | 2666 MHz | RDIMM |

now i am getting below output and it’s hard to read so do you have any example plugin which can show like above

socket 9:
frequency: 1600 MHz
hp_smart_memory: ‘Yes’
minimum_voltage: 1.50 v
part:
number: 647651-081
ranks: 1
size: 8192 MB
socket: 9
status: Good, In Use
technology: RDIMM
type: DIMM DDR3

sent offline email to Nagesh with code samples