I need to replace shell
with command
module.
Maybe you can provide more background information about the why and what you try to achieve.
Currently I guess according man zypper
you try to
packages (pa) [options] [repository]...
List all available packages or all packages from specified repositories. Similar to zypper search -s -t package
.
first and like to proceed further with something afterwards.
But I am confused command
is not working with pipe.
Right, that is the case and the intended behavior. See in example
So please give me the solution of this task
There will be not "that solution" but you may have a look into the following list from most to least preferable approaches:
- Using
package_facts
module in order to get package information as facts
- Evaluate
zypper
module in order to manage packages on SUSE and openSUSE
- Using the
zypper
command in an other syntax which doesn't need
grep
and or awk
like in
- Or writing an own Custom Module
- Or using
script
module in order to run a local script on a Remote Node after transferring it
Or, at least, just stay with shell
for commands with pipes (and your given example as it is currently)