handling specific scenarios in package module

7 views
Skip to first unread message

Bubunia Patra

unread,
Jul 8, 2019, 2:00:29 AM7/8/19
to Ansible Project
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.


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


Brian Coca

unread,
Jul 16, 2019, 9:02:54 AM7/16/19
to Ansible Project
That is what the `register` keyword is for
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#registering-variables

-
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages