adds new parameters to tcp profile module (#58185)

minor fix in policy module
This commit is contained in:
Wojciech Wypior 2019-06-21 15:07:49 +01:00 committed by Tim Rupp
parent 07fc880b3c
commit 66c828d45f
2 changed files with 174 additions and 3 deletions

View file

@ -883,7 +883,7 @@ class ModuleManager(object):
def publish_on_device(self): def publish_on_device(self):
params = dict( params = dict(
name=fq_name(self.want.partition, name=fq_name(self.want.partition,
self.want.name, self.want.policy,
sub_path='Drafts' sub_path='Drafts'
), ),
command="publish" command="publish"

View file

@ -55,6 +55,59 @@ options:
is provided by the parent profile. is provided by the parent profile.
type: bool type: bool
version_added: 2.7 version_added: 2.7
nagle:
description:
- When C(enabled) the system applies Nagle's algorithm to reduce the number of short segments on the network.
- When C(auto), the use of Nagle's algorithm is decided based on network conditions.
- Note that for interactive protocols such as Telnet, rlogin, or SSH, F5 recommends disabling this setting on
high-latency networks, to improve application responsiveness.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: str
choices:
- auto
- enabled
- disabled
version_added: 2.9
early_retransmit:
description:
- When C(yes) the system uses early fast retransmits to reduce the recovery time for connections that are
receive-buffer or user-data limited.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: bool
version_added: 2.9
proxy_options:
description:
- When C(yes) the system advertises an option, such as a time-stamp to the server only if it was negotiated
with the client.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: bool
version_added: 2.9
initial_congestion_window_size:
description:
- Specifies the initial congestion window size for connections to this destination. The actual window size is
this value multiplied by the MSS for the same connection.
- When set to C(0) the system uses the values specified in RFC2414.
- The valid value range is 0 - 16 inclusive.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: int
version_added: 2.9
initial_receive_window_size:
description:
- Specifies the initial receive window size for connections to this destination. The actual window size is
this value multiplied by the MSS for the same connection.
- When set to C(0) the system uses the Slow Start value.
- The valid value range is 0 - 16 inclusive.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: int
version_added: 2.9
syn_rto_base:
description:
- Specifies the initial RTO C(Retransmission TimeOut) base multiplier for SYN retransmission, in C(milliseconds).
- This value is modified by the exponential backoff table to select the interval for subsequent retransmissions.
- The valid value range is 0 - 5000 inclusive.
- When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
type: int
version_added: 2.9
partition: partition:
description: description:
- Device partition to manage resources on. - Device partition to manage resources on.
@ -102,10 +155,40 @@ idle_timeout:
type: int type: int
sample: 100 sample: 100
time_wait_recycle: time_wait_recycle:
description: Reuse connections in TIME-WAIT state description: Reuse connections in TIME-WAIT state.
returned: changed returned: changed
type: bool type: bool
sample: yes sample: yes
nagle:
description: Specifies the use of Nagle's algorithm.
returned: changed
type: str
sample: auto
early_retransmit:
description: Specifies the use of early fast retransmits.
returned: changed
type: bool
sample: yes
proxy_options:
description: Specifies if that the system advertises negotiated options to the server.
returned: changed
type: bool
sample: no
initial_congestion_window_size:
description: Specifies the initial congestion window size for connections to this destination.
returned: changed
type: int
sample: 5
initial_receive_window_size:
description: Specifies the initial receive window size for connections to this destination.
returned: changed
type: int
sample: 10
syn_rto_base:
description: Specifies the initial Retransmission TimeOut base multiplier for SYN retransmission.
returned: changed
type: int
sample: 2000
''' '''
from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.basic import AnsibleModule
@ -134,25 +217,47 @@ class Parameters(AnsibleF5Parameters):
'idleTimeout': 'idle_timeout', 'idleTimeout': 'idle_timeout',
'defaultsFrom': 'parent', 'defaultsFrom': 'parent',
'timeWaitRecycle': 'time_wait_recycle', 'timeWaitRecycle': 'time_wait_recycle',
'earlyRetransmit': 'early_retransmit',
'proxyOptions': 'proxy_options',
'initCwnd': 'initial_congestion_window_size',
'initRwnd': 'initial_receive_window_size',
'synRtoBase': 'syn_rto_base'
} }
api_attributes = [ api_attributes = [
'idleTimeout', 'idleTimeout',
'defaultsFrom', 'defaultsFrom',
'timeWaitRecycle', 'timeWaitRecycle',
'nagle',
'earlyRetransmit',
'proxyOptions',
'initCwnd',
'initRwnd',
'synRtoBase',
] ]
returnables = [ returnables = [
'idle_timeout', 'idle_timeout',
'parent', 'parent',
'time_wait_recycle', 'time_wait_recycle',
'nagle',
'early_retransmit',
'proxy_options',
'initial_congestion_window_size',
'initial_receive_window_size',
'syn_rto_base',
] ]
updatables = [ updatables = [
'idle_timeout', 'idle_timeout',
'parent', 'parent',
'time_wait_recycle', 'time_wait_recycle',
'nagle',
'early_retransmit',
'proxy_options',
'initial_congestion_window_size',
'initial_receive_window_size',
'syn_rto_base',
] ]
@ -185,6 +290,54 @@ class ModuleParameters(Parameters):
return 'enabled' return 'enabled'
return 'disabled' return 'disabled'
@property
def early_retransmit(self):
result = flatten_boolean(self._values['early_retransmit'])
if result is None:
return None
if result == 'yes':
return 'enabled'
return 'disabled'
@property
def proxy_options(self):
result = flatten_boolean(self._values['proxy_options'])
if result is None:
return None
if result == 'yes':
return 'enabled'
return 'disabled'
@property
def initial_congestion_window_size(self):
if self._values['initial_congestion_window_size'] is None:
return None
if 0 <= self._values['initial_congestion_window_size'] <= 16:
return self._values['initial_congestion_window_size']
raise F5ModuleError(
"Valid 'initial_congestion_window_size' must be in range 0 - 16 MSS units."
)
@property
def initial_receive_window_size(self):
if self._values['initial_receive_window_size'] is None:
return None
if 0 <= self._values['initial_receive_window_size'] <= 16:
return self._values['initial_receive_window_size']
raise F5ModuleError(
"Valid 'initial_receive_window_size' must be in range 0 - 16 MSS units."
)
@property
def syn_rto_base(self):
if self._values['syn_rto_base'] is None:
return None
if 0 <= self._values['syn_rto_base'] <= 5000:
return self._values['syn_rto_base']
raise F5ModuleError(
"Valid 'syn_rto_base' must be in range 0 - 5000 miliseconds."
)
class Changes(Parameters): class Changes(Parameters):
def to_return(self): def to_return(self):
@ -227,6 +380,16 @@ class ReportableChanges(Changes):
return 'yes' return 'yes'
return 'no' return 'no'
@property
def early_retransmit(self):
result = flatten_boolean(self._values['early_retransmit'])
return result
@property
def proxy_options(self):
result = flatten_boolean(self._values['proxy_options'])
return result
class Difference(object): class Difference(object):
def __init__(self, want, have=None): def __init__(self, want, have=None):
@ -450,6 +613,14 @@ class ArgumentSpec(object):
choices=['present', 'absent'] choices=['present', 'absent']
), ),
time_wait_recycle=dict(type='bool'), time_wait_recycle=dict(type='bool'),
nagle=dict(
choices=['enabled', 'disabled', 'auto']
),
early_retransmit=dict(type='bool'),
proxy_options=dict(type='bool'),
initial_congestion_window_size=dict(type='int'),
initial_receive_window_size=dict(type='int'),
syn_rto_base=dict(type='int'),
partition=dict( partition=dict(
default='Common', default='Common',
fallback=(env_fallback, ['F5_PARTITION']) fallback=(env_fallback, ['F5_PARTITION'])