F5Networks / f5-ansible

Imperative Ansible modules for F5 BIG-IP products
GNU General Public License v3.0
375 stars 229 forks source link

The python f5-sdk module is required #64

Closed ric79 closed 7 years ago

ric79 commented 7 years ago

Hello, when I use bigip_irule i get "The python f5-sdk module is required"

failed: [bigip-c-tolab.nfv.cselt.it] (item=aps_diameter) => {"failed": true, "irule": {"r": {"file_content": "when LB_FAILED {\nif { [active_members [LB::server pool]] > 0 } {\nafter 100\nLB::reselect pool [LB::server pool]\n}\n}\n", "module": "ltm", "name": "aps_diameter", "status": "BASE"}}, "msg": "The python f5-sdk module is required"}

This is the code:

  • bigip_irule: server: "{{inventory_hostname}}" user: "{{http.user}}" password: "{{http_password}}" validate_certs: "{{http.validate_certs}}" module: "{{irule.r.module}}" content: "{{irule.r.file_content}}" name: "{{irule.r.name}}" partition: "{{lbf5_lld.partition.name}}" state: "present" with_items: "{{lbf5_lld.partition.irules}}" loop_control: loop_var: irule label: "{{irule.r.name}}"

It seems to me very strange. I use for example bigip_vlan and I have already run

$ sudo pip install f5-sdk Requirement already satisfied: f5-sdk in /usr/lib/python2.7/site-packages Requirement already satisfied: f5-icontrol-rest<2,>=1.3.0 in /usr/lib/python2.7/site-packages (from f5-sdk) Requirement already satisfied: six<2,>=1 in /usr/lib/python2.7/site-packages (from f5-sdk) Requirement already satisfied: requests<3,>=2.5.0 in /usr/lib/python2.7/site-packages (from f5-icontrol-rest<2,>=1.3.0->f5-sdk)

I do not understand that error. Please help me

Ansible: 2.2 F5 library: latest (git clone https://github.com/F5Networks/f5-ansible.git)

caphrim007 commented 7 years ago

@ric79 your tasks must run on the local machine. So ensure that you do one of the following

  1. set your playbook's connection: to local

or

  1. In each task, use delegate_to: localhost
ric79 commented 7 years ago

Ops! you are right! During a cut&paste I missed this line. Thanks!