# Printing Information During Module Execution

**URL:** <https://forum.ansible.com/t/printing-information-during-module-execution/16277>\
**Category:** Ansible Project\
**Created:** [September 18, 2014, 4:29pm UTC](https://forum.ansible.com/t/printing-information-during-module-execution/16277 "2014-09-18T16:29:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Shef](https://avatars.discourse-cdn.com/v4/letter/b/a8b319/32.png) [@Brian\_Shef](https://forum.ansible.com/u/Brian_Shef)\
**Post date:** [September 18, 2014, 4:29pm UTC](https://forum.ansible.com/t/printing-information-during-module-execution/16277/1 "2014-09-18T16:29:31Z")

</div>

I would like to know if there is a way to print information while a module is executing – primarily as a means to demonstrate that the process is working and has not hung. Specifically, I am trying to get feedback during the execution of the **cloudformation** module. I tried modifying the source code to include the following:

`

def debug(msg):  
print json.dumps({  
“DEBUG” : msg  
})

…

debug(“The stack operation is still working…”)

`

What this did, of course, was store all this output and only print it _all_ after the module had finished executing. So for particularly large cloudformation templates, this means that I wait around for 5 minutes or so, and then suddenly see a large amount of text appear on the screen at the end. What I was expecting was to see _“The stack operation is still working…”_ printed every x seconds.

It would seem that the [**Asynchronous Actions and Polling**](http://docs.ansible.com/playbooks_async.html) are what I’m looking for… but this didn’t work, either. The entire task, “_Launch CloudFormation for {{ stackname }}_”, was skipped entirely. See below for the relevant snippet from my playbook:

`

- **name** : Launch CloudFormation for {{ stackname }}  
**cloudformation** : \>  
stack\_name=“{{ stackname }}” state=present  
region=“{{ region }}” disable\_rollback=true  
template=“{{ template }}”  
**register** : cloud  
**args** :  
**template\_parameters** :  
KeyName: “{{ keyName }}”  
Region: “{{ region }}”  
SecurityGroup: “{{ securityGroup }}”  
BootStrapper: “{{ bootStrapper }}”  
BootStrapCommand: “powershell.exe -executionpolicy unrestricted -File C:\{{ bootStrapper }} {{ region }}”  
S3Bucket: “{{ s3Bucket }}”  
**async** : 3600  
**poll** : 30

`

This tells me that **async** is meant for typical shell commands, and not complex modules such as **cloudformation**. OR – I may have done something wrong.

Could anyone shed some light on this situation? Again, for large **cloudformation** tasks that take a while, I would like some periodic indication that the task is still running, and not hanging. I appreciate the help!
