code: def add_op(state, op_func, *args, **kwargs):
      '''
      Prepare & add an operation to ``pyinfra.state`` by executing it on all hosts.
  
      Args:
          state (``pyinfra.api.State`` obj): the deploy state to add the operation
          to op_func (function): the operation function from one of the modules,
          ie ``server.user``
          args/kwargs: passed to the operation function
      '''
  
      frameinfo = get_caller_frameinfo()
      kwargs['frameinfo'] = frameinfo
  
      for host in state.inventory:
          op_func(state, host, *args, **kwargsf add_op(state, op_func, *args, **kwargs):
      '''
      Prepare & add an operation to ``pyinfra.state`` by executing it on all hosts.
  
      Args:
          state (``pyinfra.api.State`` obj): the deploy state to add the operation
          to op_func (function): the operation function from one of the modules,
          ie ``server.user``
          args/kwargs: passed to the operation function
      '''
  
      frameinfo = get_caller_frameinfo()
      kwargs['frameinfo'] = frameinfo
  
      for host in state.inventory:
          op_func(state, host, *args, **kwargs)
docs: Prepare & add an operation to ``pyinfra.state`` by executing it on all hosts.
  
      Args:
          state (``pyinfra.api.State`` obj): the deploy state to add the operation
          to op_func (function): the operation function from one of the modules,
          ie ``server.user``
          args/kwargs: passed to the operation function