Forum Discussion
Zuke
Cirrostratus
Mike your whitespace looks off. I pasted your playbook as printed above to yamllint.com and got errors. Try this.
---
tasks:
-
bigip_command:
commands:
- "netstat -rn | grep \"^0.0.0.0\" | grep -v mgmt | awk '{print $2}'"
provider: "{{ provider }}"
name: "Default Gateway"
register: f5_gateway_output
-
debug:
var: f5_gateway_output
Zuke
Feb 18, 2021Cirrostratus
No I haven't successfully run a bash command with this module, and the documentation on the Ansible page is ambiguous. "Run TMSH and bash commands" headline and every example shows a command that is executed in TMSH. I've tried running this playbook with two commands given, the first command being "bash" but no luck. I still get the encoding error.
https://docs.ansible.com/ansible/latest/collections/f5networks/f5_modules/bigip_command_module.html#ansible-collections-f5networks-f5-modules-bigip-command-module
FWIW I think I will use a different, non-F5 module if I'm going to use bash commands going forward.