# handling specific scenarios in package module

**URL:** <https://forum.ansible.com/t/handling-specific-scenarios-in-package-module/30720>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [July 8, 2019, 6:00am UTC](https://forum.ansible.com/t/handling-specific-scenarios-in-package-module/30720 "2019-07-08T06:00:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bubunia\_Patra](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@Bubunia\_Patra](https://forum.ansible.com/u/Bubunia_Patra)\
**Post date:** [July 8, 2019, 6:00am UTC](https://forum.ansible.com/t/handling-specific-scenarios-in-package-module/30720/1 "2019-07-08T06:00:29Z")

</div>

Hi all,

I am using package module to install packages in the system. But I need to handle a specific case for example some ubuntu kernel requires some specific command to be run for installing the package.

[https://docs.ansible.com/ansible/2.5/modules/package\_module.html](https://docs.ansible.com/ansible/2.5/modules/package_module.html)

I want to store the package module output to a variable and check whether specific strings appear in stdout and handle that specific case. Can anyone help how can I achieve this ?  
Any code snippet will help.

Regards  
Pradeep

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [July 16, 2019, 1:02pm UTC](https://forum.ansible.com/t/handling-specific-scenarios-in-package-module/30720/2 "2019-07-16T13:02:20Z")

</div>

That is what the `register` keyword is for  
[https://docs.ansible.com/ansible/latest/user\_guide/playbooks\_variables.html#registering-variables](https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#registering-variables)
