For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

KernelPanic's avatar
KernelPanic
Icon for Nimbostratus rankNimbostratus
Jan 25, 2018

Ansible bigip_pool_member fails if node exists

When I create pool members after the nodes have been added the module fails with the below error. This passes syntax check but blows up when I run it against an F5. The other tasks in this role are working as well.

TMOS 12.1.2 HF2
        ansible --version
        ansible 2.4.2.0
          config file = /etc/ansible/ansible.cfg
          configured module search path = ['/home/brian/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
          ansible python module location = /usr/lib/python3.5/site-packages/ansible
          executable location = /usr/bin/ansible
          python version = 3.5.4 (default, Aug 23 2017, 18:32:05) [GCC 6.4.1 20170727 (Red Hat 6.4.1-1)]

    The Play
    ===============================================
     - name: "Create Node3 {{node3nm}} on {{inventory_hostname}}"
        bigip_node:
          server: "{{inventory_hostname}}"
          user: "{{adminuser}}"
          password: "{{adminpass}}"
          validate_certs: "False"
          host: "{{node3ip}}"
          name: "{{node3nm}}"
          state: "present"
          partition: Common
          monitor_type: and_list
          monitors:
            - icmp
        delegate_to: localhost

      - name: "Create Pool Members in {{appnm}}-Pool on {{inventory_hostname}}"
        bigip_pool_member:
          description: "{{appnm}} {{dc}} {{zone}} {{listen}}"
          server: "{{inventory_hostname}}"
          user: "{{adminuser}}"
          password: "{{adminpass}}"
          validate_certs: "False"
          partition: "Common"
          state: "present"
          session_state: "enabled"
          port: "{{listen}}"
          host: "{{item}}"
          pool: "{{appnm}}_{{dc}}_{{zone}}_{{listen}}_POOL"
        with_items:
            - "{{node1ip}}"
            - "{{node2ip}}"
            - "{{node3ip}}"
        delegate_to: localhost

    =============================================
    The Error
      },
        "item": "192.168.131.23",
        "msg": "received exception: Server raised fault: 'Exception caught in LocalLB::urn:iControl:LocalLB/Pool::add_member_v2()\nException: Common::OperationFailed\n\tprimary_error_code   : 17236026 (0x0107003A)\n\tsecondary_error_code : 0\n\terror_string         : 0107003a:3: Pool member node (/Common/192.168.131.23) and existing node (/Common/www-3) cannot use the same IP Address (192.168.131.23).'"
    }

1 Reply

  • I needed to use the node name variable when adding the member, not the node ip.

          host: "{{item}}"
          pool: "{{appnm}}_{{dc}}_{{zone}}_{{listen}}_POOL"
        with_items:
            - "{{node1nm}}"
            - "{{node2nm}}"
            - "{{node3nm}}"