In ansible, there is a module called delegate_to, in this module area give the specific host (or) has where your errands (or) assignment should be run.
undertakings:
name: ” Elasticsearch Hitting”
uri: url=’_search?q=status:new’ headers='{“Content-type”:”application/json”}’ method=GET return_content=yes
register: yield
delegate_to: 127.0.0.1