- name:Create VMSS with security group in same resource group, with accelerated networking.
azure_rm_virtualmachine_scaleset:
resource_group:"{{ resource_group }}"
name:testVMSS{{ rpfx }}2
vm_size:Standard_D3_v2
capacity:1
virtual_network_name:testVnet
subnet_name:testSubnet
admin_username:testuser
ssh_password_enabled:true
admin_password:"Password1234!"
image:
name:testimagea
resource_group:"{{ resource_group }}"
upgrade_policy:Manual
security_group:testNetworkSecurityGroup
enable_accelerated_networking:yes
register:results
- name:Assert that nothing has changed
assert:
that:
- not results.changed
- name:Create VMSS with security group in same resource group, with accelerated networking.
azure_rm_virtualmachine_scaleset:
resource_group:"{{ resource_group }}"
name:testVMSS{{ rpfx }}2
vm_size:Standard_D3_v2
capacity:1
virtual_network_name:testVnet
subnet_name:testSubnet
admin_username:testuser
ssh_password_enabled:true
admin_password:"Password1234!"
image:
name:testimageb
resource_group:"{{ resource_group }}"
upgrade_policy:Manual
security_group:testNetworkSecurityGroup
enable_accelerated_networking:yes
register:results
- name:Assert that something has changed
assert:
that:
- results.changed
- name:update VMSS with security group in different resource group.
azure_rm_virtualmachine_scaleset:
resource_group:"{{ resource_group }}"
@ -260,21 +345,20 @@
ssh_password_enabled:true
admin_password:"Password1234!"
image:
offer:CoreOS
publisher:CoreOS
sku:Stable
version:latest
name:testimageb
resource_group:"{{ resource_group }}"
upgrade_policy:Manual
security_group:
name:testNetworkSecurityGroup2
resource_group:"{{ resource_group_secondary }}"
register:results
- name:Assert that security group is correct
assert:
that:
- 'results.changed'
- '"testNetworkSecurityGroup2" in results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup.id'
# disable for now
#- name: Assert that security group is correct
# assert:
# that:
# - 'results.changed'
# - '"testNetworkSecurityGroup2" in results.ansible_facts.azure_vmss.properties.virtualMachineProfile.networkProfile.networkInterfaceConfigurations.0.properties.networkSecurityGroup.id'