Forum Discussion
Zuke
Feb 05, 2021Cirrostratus
Ansible bigip_command module error message
I'm trying to run a simple playbook to create a link in bash: ---
- name: Issue a command on the F5 devices
hosts: all
connection: local
environment:
F5_SERVER: '{{ ansible_host |...
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
Mike_A
Feb 17, 2021Nimbostratus
Zuke, even with what you pasted, I get the same response.
"executed_commands": [
"tmsh -c \\\"netstat -rn \\\" | grep \\\"^0.0.0.0\\\" | grep -v mgmt | awk \\'{print \\$2}\\'"
],
As you can see it is inserting "tmsh -c" before any command that is under the bigip_command module.
This module says it runs bash, I'm questioning how that is possible when "tmsh -c" is inserted before any command.
Have you successfully run a bash command with this bigip_command module?
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects