# Inventory path in ansible plugin

**URL:** <https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135>\
**Category:** Ansible Project\
**Created:** [July 24, 2018, 12:06pm UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135 "2018-07-24T12:06:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [July 24, 2018, 12:06pm UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135/1 "2018-07-24T12:06:14Z")

</div>

How to get inventory path in call back plugin:

I found this, however it is not working

| 

def v2\_playbook\_on\_start(self, playbook):

 |
| | 
# On Ansible v2, Ansible doesn’t set `self.playbook` automatically
 |
| | 

self.playbook = playbook

 |
| | |
| | 

playbook\_file\_name = self.playbook.\_file\_name

 |
| | 

inventory = self.\_options.inventory

 |
| | |
| | 

self.start\_timer()

 |
| | |
| | 
# Set the playbook name from its filename
 |
| | 

self.\_playbook\_name, \_ = os.path.splitext(

 |
| | 

os.path.basename(playbook\_file\_name))

 |
| | 

if isinstance(inventory, list):

 |
| | 

inventory = ‘,’.join(inventory)

 |
| | 

self.\_inventory\_name = ‘,’.join([os.path.basename(os.path.realpath(name)) for name in inventory.split(‘,’) if name])

 |

In short, is there a way to check which parameter is used for what in v2\_playbook\_on\_start(self, playbook):

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [July 25, 2018, 3:28pm UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135/2 "2018-07-25T15:28:27Z")

</div>

Any update on this will be appreciated

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [July 25, 2018, 3:32pm UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135/3 "2018-07-25T15:32:19Z")

</div>

You might wanna try the developer list.

---

<div class="post-metadata">

**Author:** ![ansiblekrazy](https://avatars.discourse-cdn.com/v4/letter/a/c37758/32.png) [@ansiblekrazy](https://forum.ansible.com/u/ansiblekrazy)\
**Post date:** [July 25, 2018, 4:01pm UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135/4 "2018-07-25T16:01:30Z")

</div>

what is developer list …

---

<div class="post-metadata">

**Author:** ![dan\_linder](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dan_linder/32/3833_2.png) [@dan\_linder](https://forum.ansible.com/u/dan_linder)\
**Post date:** [July 26, 2018, 2:48am UTC](https://forum.ansible.com/t/inventory-path-in-ansible-plugin/28135/5 "2018-07-26T02:48:43Z")

</div>

The link to the Ansible development list is:

[https://groups.google.com/forum/#!forum/ansible-devel](https://groups.google.com/forum/#!forum/ansible-devel)
