nornir.core.processor
class nornir.core.processor.Processor
(\args, **kwargs*)
This defines the Processor interface. A processor plugin needs to implement each method with the same exact signature. It’s not necessary to subclass it.
A processor is a plugin that gets called when certain events happen.
subtask_instance_completed
(task: nornir.core.task.Task, host: nornir.core.inventory.Host, result: nornir.core.task.MultiResult) → NoneThis method is called when a host completes executing a subtask
subtask_instance_started
(task: nornir.core.task.Task, host: nornir.core.inventory.Host) → NoneThis method is called before a host starts executing a subtask
task_completed
(task: nornir.core.task.Task, result: nornir.core.task.AggregatedResult) → NoneThis method is called when all the hosts have completed executing their respective task
task_instance_completed
(task: nornir.core.task.Task, host: nornir.core.inventory.Host, result: nornir.core.task.MultiResult) → NoneThis method is called when a host completes its instance of a task
task_instance_started
(task: nornir.core.task.Task, host: nornir.core.inventory.Host) → NoneThis method is called before a host starts executing its instance of the task
task_started
(task: nornir.core.task.Task) → NoneThis method is called right before starting the task
class nornir.core.processor.Processors
Processors is a wrapper class that holds a list of Processor. Each method will just iterate over all the the Processor objects in self
and call its method. For instance:
>>> def my_method(...):
>>> for p in self:
>>> p.my_method(...)
subtask_instance_completed
(task: nornir.core.task.Task, host: nornir.core.inventory.Host, result: nornir.core.task.MultiResult) → Nonesubtask_instance_started
(task: nornir.core.task.Task, host: nornir.core.inventory.Host) → Nonetask_completed
(task: nornir.core.task.Task, result: nornir.core.task.AggregatedResult) → Nonetask_instance_completed
(task: nornir.core.task.Task, host: nornir.core.inventory.Host, result: nornir.core.task.MultiResult) → Nonetask_instance_started
(task: nornir.core.task.Task, host: nornir.core.inventory.Host) → Nonetask_started
(task: nornir.core.task.Task) → None