Forum Discussion
Ichnafi
Mar 09, 2023Cirrostratus
Ansible - Running bash commands with bigip_command module - How it's done
Hello fellow F5ers, the description of the F5 Ansible-Module "bigip_command" states it would "[...]Run TMSH and BASH commands on F5 devices[...]" Scrolling through the documentation, you will only ...
bowlermj
May 31, 2024Employee
Is the expected output from this going to be in JSON decodable format, or no? I'm trying to run a script that comes with TMOS (temp folder cleanup), and it keeps erroring out with the following.
TASK [Run clean_tmsh_tmp_dirs script against a BIG-IP] ************************************************************************************************************** fatal: [10.1.1.15 -> localhost]: FAILED! => {"changed": false, "msg": "No JSON object could be decoded"}
Here's the playbook:
---
- name: Run clean_tmsh_tmp_dirs script against BIG-IPs
hosts: all
connection: local
vars:
provider:
password:
server: localhost
user: admin
validate_certs: no
server_port: 443
tasks:
- name: Run clean_tmsh_tmp_dirs script against a BIG-IP
bigip_command:
commands: run /util bash -c 'yes yes | /usr/local/bin/clean_tmsh_tmp_dirs'
provider: "{{ provider }}"
delegate_to: localhost
Thanks,
Matt
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