Forum Discussion
bigip_irule
I'm trying to create an iRule with the following task:
- name: iRule
bigip_irule:
module: ltm
name: myRule
src: /var/tmp/myRule.tcl
state: present
provider:
server: "{{ inventory_hostname }}"
user: "{{ remote_username }}"
password: "{{ remote_passwd }}"
validate_certs: no
delegate_to: localhost
The issue I'm running into is that when I execute the play I'm getting a message saying it can't find the source. I'm assuming that for this field you are to copy the irule to any directory on the LTM? Or am I missing something here?
Error message:
"msg": "The specified 'src' was not found."
- Dario_Garrido
Noctilucent
Hello PG0581
Documentation says "src: The iRule file to interpret and upload to the BIG-IP".
In the same article also says "src: The filename that included the iRule source (Sample:
/opt/src/irules/example1.tcl)"
REF - https://clouddocs.f5.com/products/orchestration/ansible/devel/modules/bigip_irule_module.html
So the file should be located in /var/tmp folder in your ansible machine. Does it help?
KR,
Dario.
- Dario_Garrido
Noctilucent
BTW, that's the implementation code for this section in 'bigip_irule'.
@property def src_content(self): if not os.path.exists(self._values['src']): raise F5ModuleError( "The specified 'src' was not found." ) with open(self._values['src']) as f: result = f.read() return result
REF - https://github.com/F5Networks/f5-ansible/blob/devel/library/modules/bigip_irule.py
- PG0581
Cirrus
Hi Dario. Thanks for your reply. I was making the mistake of not running it from the playbook directory (as you've mentioned above). I have it working now, thanks for your assistance
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