I have few playbooks which have run in parallel in background, so I used subprocess.Popen function.
Is there a way/method/function which can interpret completion status from each Popen call. So based on it I can run few more commands to make this program complete.
subprocess.run('ansible-playbook -i inventory/inventorydata-post-patch-gb.yml', shell=True, check=True)
subprocess.Popen('nohup ansible-playbook -i inventory/inventory data-post-patch-db.yml --extra-vars "db_home_1=/u01/app/oracle/product/19.0.0.0/dbhome_1 db_name=aswsdac db_sid_name=aswsdac1" &>aswsdac1.out ', shell=True)
subprocess.Popen('nohup ansible-playbook -i inventory/inventory exadata-post-patch-db.yml --extra-vars "db_home_1=/u01/app/oracle/product/19.0.0.0/dbhome_1 db_name=aswsdad db_sid_name=aswsdad1" &>aswsdad1.out', shell=True)