I am trying to use ansible to automate some commands on a Juniper device. However the commands require me to use '|' (pipes). Reading over the Junos_command module documentation, pipes cannot be used.
This module does NOT use the Junos CLI to execute the CLI command. Instead, it uses the <command> RPC over a NETCONF channel. The <command> RPC takes a CLI command as it’s input and is very similar to executing the command on the CLI, but you can NOT include any pipe modifies (i.e. | match, | count, etc.) with the CLI commands executed by this module.
I tried using escape characters \
, however it still does not work.
Something I thought of was using raw shell commands through ansible to ssh to the device and run the command (independent of the junos_command module), but this seems like a lot of work and I forego a lot of useful functioality by not using the module.
Which other methods can I employ to actually pass a command with a pipe using this module.