Forum Discussion
Ansible bigip_command module error message
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_outputNo 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.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com