I have an API that I built that takes system configuration parameters as playbook variables and builds playbooks on the fly and attempts to run them. I can hit my API but Ansible throws the following error when invoked via

```
Options = namedtuple('Options', ['connection', 'module_path', 'forks', 'become', 'become_method', 'become_user', 'check', 'diff', 'listhosts', 'listtasks', 'listtags', 'syntax'])
loader = DataLoader()
options = Options(connection='local', module_path='%s/' % (ROOT_DIR), forks=100, become=None, become_method=None, become_user=None, check=False,
                diff=False, listhosts=False, listtasks=False, listtags=False, syntax=False)
passwords = dict(vault_pass='secret')

inventory = InventoryManager(loader=loader, sources=[inventory_path])
variable_manager = VariableManager(loader=loader, inventory=inventory)
executor = PlaybookExecutor(  
            playbooks=[playbook_path], inventory=inventory, variable_manager=variable_manager, loader=loader,  
            options=options, passwords=passwords)  
results = executor.run()  

```

Here is the error:

> 
> fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"`echo /tmp/ansible/ansible-tmp-1527184628.45-99532072739462`\" && echo ansible-tmp-1527184628.45-99532072739462=\"`echo /tmp/ansible/ansible-tmp-1527184628.45-99532072739462`\" ), exited with result 127", "unreachable": true}
> 
> 
> 

The playbook is run on localhost and my connection parameter is set to local as well so i am not sure what the issue is.