|
|
@ -24,12 +24,14 @@ module: bigip_pool_member
|
|
|
|
short_description: "Manages F5 BIG-IP LTM pool members"
|
|
|
|
short_description: "Manages F5 BIG-IP LTM pool members"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "Manages F5 BIG-IP LTM pool members via iControl SOAP API"
|
|
|
|
- "Manages F5 BIG-IP LTM pool members via iControl SOAP API"
|
|
|
|
version_added: "TBD"
|
|
|
|
version_added: "1.3"
|
|
|
|
author: Matt Hite
|
|
|
|
author: Matt Hite
|
|
|
|
notes:
|
|
|
|
notes:
|
|
|
|
- "Requires BIG-IP software version >= 11"
|
|
|
|
- "Requires BIG-IP software version >= 11"
|
|
|
|
- "F5 developed module 'bigsuds' required (see http://devcentral.f5.com)"
|
|
|
|
- "F5 developed module 'bigsuds' required (see http://devcentral.f5.com)"
|
|
|
|
- "Best run as a local_action in your playbook"
|
|
|
|
- "Best run as a local_action in your playbook"
|
|
|
|
|
|
|
|
- "Supersedes bigip_pool for managing pool members"
|
|
|
|
|
|
|
|
|
|
|
|
requirements:
|
|
|
|
requirements:
|
|
|
|
- bigsuds
|
|
|
|
- bigsuds
|
|
|
|
options:
|
|
|
|
options:
|
|
|
@ -77,14 +79,14 @@ options:
|
|
|
|
aliases: []
|
|
|
|
aliases: []
|
|
|
|
host:
|
|
|
|
host:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "Pool member IP"
|
|
|
|
- Pool member IP
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
choices: []
|
|
|
|
choices: []
|
|
|
|
aliases: ['address', 'name']
|
|
|
|
aliases: ['address', 'name']
|
|
|
|
port:
|
|
|
|
port:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- "Pool member port"
|
|
|
|
- Pool member port
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
choices: []
|
|
|
|
choices: []
|
|
|
@ -121,10 +123,54 @@ options:
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = '''
|
|
|
|
|
|
|
|
|
|
|
|
TBD
|
|
|
|
## playbook task examples:
|
|
|
|
TBD
|
|
|
|
|
|
|
|
TBD
|
|
|
|
---
|
|
|
|
TBD
|
|
|
|
# file bigip-test.yml
|
|
|
|
|
|
|
|
# ...
|
|
|
|
|
|
|
|
- hosts: bigip-test
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
|
|
|
- name: Add pool member
|
|
|
|
|
|
|
|
local_action: >
|
|
|
|
|
|
|
|
bigip_pool_member
|
|
|
|
|
|
|
|
server=lb.mydomain.com
|
|
|
|
|
|
|
|
user=admin
|
|
|
|
|
|
|
|
password=mysecret
|
|
|
|
|
|
|
|
state=present
|
|
|
|
|
|
|
|
pool=matthite-pool
|
|
|
|
|
|
|
|
partition=matthite
|
|
|
|
|
|
|
|
host="{{ ansible_default_ipv4["address"] }}"
|
|
|
|
|
|
|
|
port=80
|
|
|
|
|
|
|
|
description="web server"
|
|
|
|
|
|
|
|
connection_limit=100
|
|
|
|
|
|
|
|
rate_limit=50
|
|
|
|
|
|
|
|
ratio=2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Modify pool member ratio and description
|
|
|
|
|
|
|
|
local_action: >
|
|
|
|
|
|
|
|
bigip_pool_member
|
|
|
|
|
|
|
|
server=lb.mydomain.com
|
|
|
|
|
|
|
|
user=admin
|
|
|
|
|
|
|
|
password=mysecret
|
|
|
|
|
|
|
|
state=present
|
|
|
|
|
|
|
|
pool=matthite-pool
|
|
|
|
|
|
|
|
partition=matthite
|
|
|
|
|
|
|
|
host="{{ ansible_default_ipv4["address"] }}"
|
|
|
|
|
|
|
|
port=80
|
|
|
|
|
|
|
|
ratio=1
|
|
|
|
|
|
|
|
description="nginx server"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Remove pool member from pool
|
|
|
|
|
|
|
|
local_action: >
|
|
|
|
|
|
|
|
bigip_pool_member
|
|
|
|
|
|
|
|
server=lb.mydomain.com
|
|
|
|
|
|
|
|
user=admin
|
|
|
|
|
|
|
|
password=mysecret
|
|
|
|
|
|
|
|
state=absent
|
|
|
|
|
|
|
|
pool=matthite-pool
|
|
|
|
|
|
|
|
partition=matthite
|
|
|
|
|
|
|
|
host="{{ ansible_default_ipv4["address"] }}"
|
|
|
|
|
|
|
|
port=80
|
|
|
|
|
|
|
|
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
@ -231,7 +277,6 @@ def set_ratio(api, pool, address, port, ratio):
|
|
|
|
api.LocalLB.Pool.set_member_ratio(pool_names=[pool], members=[members], ratios=[[ratio]])
|
|
|
|
api.LocalLB.Pool.set_member_ratio(pool_names=[pool], members=[members], ratios=[[ratio]])
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
def main():
|
|
|
|
|
|
|
|
|
|
|
|
module = AnsibleModule(
|
|
|
|
module = AnsibleModule(
|
|
|
|
argument_spec = dict(
|
|
|
|
argument_spec = dict(
|
|
|
|
server = dict(type='str', required=True),
|
|
|
|
server = dict(type='str', required=True),
|
|
|
@ -278,7 +323,7 @@ def main():
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
api = bigip_api(server, user, password)
|
|
|
|
api = bigip_api(server, user, password)
|
|
|
|
if not pool_exists(api, pool):
|
|
|
|
if not pool_exists(api, pool):
|
|
|
|
module.fail_json(msg="pool does not exist")
|
|
|
|
module.fail_json(msg="pool %s does not exist" % pool)
|
|
|
|
result = {'changed': False} # default
|
|
|
|
result = {'changed': False} # default
|
|
|
|
|
|
|
|
|
|
|
|
if state == 'absent':
|
|
|
|
if state == 'absent':
|
|
|
|