Our team have been trying to develop some GUI for the ansible execution and I wanted to know if there is some way to pause the execution of the playbook midway with just command line argument. I am familiar with the Pause option but that needs to be added in the YAML, we don't want that. I am also familiar with the --step argument passed on the CLI, that's close to what we want but not specifically.
Thanks.
While the playbook is running you can press ctrl + s to freeze the console and then ctrl + q to resume it.
I believe that you have found the only two options that would stop a playbook mid-play (pause and --step). As you're probably aware, Ansible is designed to run roles/playbooks start to finish without user intervention. Anything that allows you to stop mid-execution is really just for debugging.
What are you trying to accomplish by building a custom GUI? Have you looked into AWX?