Getting Unable to find an inventory file error programtically in Python

26 views
Skip to first unread message

John Yeuk Hon Wong

unread,
Oct 8, 2015, 5:44:10 PM10/8/15
to Ansible Project
Hi I am working with Ansible API but I run into problem with the Playbook module.

I've done some reading in https://github.com/oriolrius/programming-ansible-basics/blob/master/test_playbook.py and also looked through help(Inventory). Despite Inventory object has methods like is_file.

But it seems like PlayBook is expecting file instead?

Literally my code is like what's in ansible code:

    self._playbook = ansible_playbook.PlayBook(
      playbook=pb_path,
      inventory=self._inventory,
      stats=stats,
      runner_callbacks=runner_cb,
      callbacks=playbook_cb,
      **other_options
    )

Thoughts?

Thanks.
Reply all
Reply to author
Forward
0 new messages