Forum Discussion
Andy_Herrman_22
Nimbostratus
May 25, 2010Load iRule from external file using bigpipe
The iRules that I use are stored in .tcl files in source control. I'm trying to write a simple perl script that can be used by our deployment team to do the next deploy and I'm wondering if there's a way I could construct a `bigpipe` command to load the iRule from the file. I'm not seeing anything in `b rule help` to suggest it can load from an external file.
I'm using BIG-IP Version 9.3.0 178.5
- Keith_106951
Nimbostratus
I don't believe there is a way to "read in" an external file using bigpipe. Are you just trying to keep them abstracted from the F5 CLI and GUI? If so, you could always just give them the iRule Editor. - Andy_Herrman_22
Nimbostratus
I'm trying to make the deploy as brain-dead as possible. My preference is they scp the files to the bigip, run the script, and they're done. - The iControl interface for iRules is very simple and I'm sure I've got a few samples of loading/saving iRules. I'll check when I get back into the office. The nice thing about the perl interface is that all the required libraries are already on the LTM. I'll post if I find something (or when I write one for you).
- Andy_Herrman_22
Nimbostratus
iControl felt a bit like overkill to me. Also, I don't actually *know* perl, and generally just use it to automate the creation of shell commands. I'm very used to the bigpipe command, so it felt natural to just write a script to automatically generate the bigpipe commands I was already used to using. - I just uploaded an iControl script that illustrates almost all of the methods in the LocalLB Rule interface. I tested it an it runs find directly on my BIG-IP so you can just save it there an use it. The usage is as follows:
Usage: LocalLBRule.pl host uid pwd [options] [options] list - List all iRules backup dirname - Backup all iRules to specified local directory load filename - Load single iRule from specified filename (iRule name from filename) get iRulename - Display specified iRule delete iRulename - Delete specified iRule stats iRulename - Get Statistics for specified iRule
- Oh, one more thing. If you are running this from the LTM, you can point the script at localhost and it will not require credentials to login for the iControl calls. So you can pass anything to the username/password fields and the script will still work.
- JRahm
Admin
FYI...Once you get to version 10.1 or greater, you can use tmsh scripting to pull iRules from external files.
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