# Getting A ID Value Unique To An Instance Of An Ansible Playbook

**URL:** <https://forum.ansible.com/t/getting-a-id-value-unique-to-an-instance-of-an-ansible-playbook/35594>\
**Category:** Ansible Developer\
**Created:** [August 6, 2021, 7:11am UTC](https://forum.ansible.com/t/getting-a-id-value-unique-to-an-instance-of-an-ansible-playbook/35594 "2021-08-06T07:11:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dhiwakar\_Ravikumar](https://avatars.discourse-cdn.com/v4/letter/d/ecc23a/32.png) [@Dhiwakar\_Ravikumar](https://forum.ansible.com/u/Dhiwakar_Ravikumar)\
**Post date:** [August 6, 2021, 7:11am UTC](https://forum.ansible.com/t/getting-a-id-value-unique-to-an-instance-of-an-ansible-playbook/35594/1 "2021-08-06T07:11:02Z")

</div>

I’m trying to create an external file that every single task (Python modules for which I’ve implemented) in the playbook should read from and write into some information.

I wanted to use the process ID for the playbook itself but I’m not sure how to fetch this information from within the module itself i.e. the python script itself.

$PPID keeps changing as evidenced by the following playbook.

 ![Untitled.png](https://us1.discourse-cdn.com/ansible/original/2X/6/62cbf5e9f7676faf62fd7b8b381b2283e017bc59.png)

the value for the PPID was

“stdout”: “2850132”  
“stdout”: “2850343”

the 1st and 2nd times respectively. Is there any value like a process ID or something similar that is

1. Unique to this instance of the playbook run ?
2. Accessible to the module’s underlying python script ?
3. Without involving use of psutil or any package that doesn’t come as part of Python 3.X

For a better reading experience, check out  
[https://stackoverflow.com/questions/68677124/getting-a-id-value-unique-to-an-instance-of-an-ansible-playbook](https://stackoverflow.com/questions/68677124/getting-a-id-value-unique-to-an-instance-of-an-ansible-playbook)
