mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Changed Azure SecurityRule to use kwargs instead of positional args (#37695)
This commit is contained in:
@@ -770,17 +770,41 @@ class AzureRMModuleBase(object):
|
|||||||
if os_type == 'Linux':
|
if os_type == 'Linux':
|
||||||
# add an inbound SSH rule
|
# add an inbound SSH rule
|
||||||
parameters.security_rules = [
|
parameters.security_rules = [
|
||||||
self.network_models.SecurityRule('Tcp', '*', '*', 'Allow', 'Inbound', description='Allow SSH Access',
|
self.network_models.SecurityRule(protocol='Tcp',
|
||||||
source_port_range='*', destination_port_range='22', priority=100, name='SSH')
|
source_address_prefix='*',
|
||||||
|
destination_address_prefix='*',
|
||||||
|
access='Allow',
|
||||||
|
direction='Inbound',
|
||||||
|
description='Allow SSH Access',
|
||||||
|
source_port_range='*',
|
||||||
|
destination_port_range='22',
|
||||||
|
priority=100,
|
||||||
|
name='SSH')
|
||||||
]
|
]
|
||||||
parameters.location = location
|
parameters.location = location
|
||||||
else:
|
else:
|
||||||
# for windows add inbound RDP and WinRM rules
|
# for windows add inbound RDP and WinRM rules
|
||||||
parameters.security_rules = [
|
parameters.security_rules = [
|
||||||
self.network_models.SecurityRule('Tcp', '*', '*', 'Allow', 'Inbound', description='Allow RDP port 3389',
|
self.network_models.SecurityRule(protocol='Tcp',
|
||||||
source_port_range='*', destination_port_range='3389', priority=100, name='RDP01'),
|
source_address_prefix='*',
|
||||||
self.network_models.SecurityRule('Tcp', '*', '*', 'Allow', 'Inbound', description='Allow WinRM HTTPS port 5986',
|
destination_address_prefix='*',
|
||||||
source_port_range='*', destination_port_range='5986', priority=101, name='WinRM01'),
|
access='Allow',
|
||||||
|
direction='Inbound',
|
||||||
|
description='Allow RDP port 3389',
|
||||||
|
source_port_range='*',
|
||||||
|
destination_port_range='3389',
|
||||||
|
priority=100,
|
||||||
|
name='RDP01'),
|
||||||
|
self.network_models.SecurityRule(protocol='Tcp',
|
||||||
|
source_address_prefix='*',
|
||||||
|
destination_address_prefix='*',
|
||||||
|
access='Allow',
|
||||||
|
direction='Inbound',
|
||||||
|
description='Allow WinRM HTTPS port 5986',
|
||||||
|
source_port_range='*',
|
||||||
|
destination_port_range='5986',
|
||||||
|
priority=101,
|
||||||
|
name='WinRM01'),
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
# Open custom ports
|
# Open custom ports
|
||||||
|
|||||||
Reference in New Issue
Block a user