Forum Discussion

ml4den_387195's avatar
ml4den_387195
Icon for Nimbostratus rankNimbostratus
Mar 28, 2019
Solved

How to address multiple BIG-IP servers in one Ansible task?

How to address multiple BIG-IP servers in one Ansible task? Ansible noob here, I'm trying to automate the configuration of large numbers of pools (and other things) using Ansible. I have a hosts ...
  • ml4den_387195's avatar
    Mar 28, 2019

    Resolved: the answer is to use the "inventory_hostname" variable like this:

    tasks:
       - name: Create app1 server pool
         bigip_pool:
          name: app1_pl
          monitors: "/Common/http"
          lb_method: round-robin
          password: "adminpassword"
          server: "{{inventory_hostname}}"
          user: "adminuser"
          validate_certs: no
         delegate_to: localhost
    

    This will cause Ansible to loop through the servers in the inventory/hosts group that we pass it. In my case the group is called "f5lab".