Anyway of specifying host in ansible.runner?

The inventory style is not working to well for what I want to do.

I am building my own scripts on top of the ansible API, and I need to work with one host at a time, so that I can present configuration values and prompt the user before making changes one host at a time. I am also logging information that comes back from json, and I have this coded to parse one host at a time.

I guess I could re-develop this, but if there was a ‘remote_host’, like there is for ‘remote_user’ - it would be really helpful.

Is there anything that will allow me to parse the host value in ansible.runner.Runner()?

For future ref in case anyone searches, I used a NameTemporaryFile

from tempfile import NamedTemporaryFile

def load_temporary_inventory(content):
tmpfile = NamedTemporaryFile()
try:
tmpfile.write(content)
tmpfile.seek(0)
inventory = Inventory(tmpfile.name)
finally:
tmpfile.close()
return inventory

def ping(hostname):
inventory = load_temporary_inventory(hostname)
runner = Runner(
module_name=‘ping’,
inventory=inventory,
)
return runner.run()

Found this on stackexchange.