added location as mandatory parameter instead of affinity group
This commit is contained in:
Родитель
b6b031f002
Коммит
5f628c0412
|
@ -81,7 +81,7 @@ Manage Virtual Network
|
|||
Creating virtual network
|
||||
|
||||
$puppet azure_vnet set --management-certificate pem-or-pfx-file-path --azure-subscription-id=your-subscription-id
|
||||
--virtual-network-name vnetname --affinity-group-name ag-name --address-space '172.16.0.0/12,192.168.0.0/16'
|
||||
--virtual-network-name vnetname --location 'West US' --address-space '172.16.0.0/12,192.168.0.0/16'
|
||||
--dns-servers 'dns-1:10.10.8.8,dns-2:172.8.4.4' --subnets 'subnet-1:172.16.0.0:12,subnet-2:192.168.0.0:29'
|
||||
|
||||
Other avaliable actions are
|
||||
|
|
|
@ -39,7 +39,7 @@ Puppet::Face.define :azure_vnet, '1.0.0' do
|
|||
end
|
||||
virtual_network_service.set_network_configuration(
|
||||
options[:virtual_network_name],
|
||||
options[:affinity_group_name],
|
||||
options[:location],
|
||||
address_space,
|
||||
optional
|
||||
)
|
||||
|
@ -53,8 +53,7 @@ Puppet::Face.define :azure_vnet, '1.0.0' do
|
|||
--azure-subscription-id=YOUR-SUBSCRIPTION-ID \
|
||||
--dns-servers 'google-1:8.8.8.8,google-2:8.8.4.4' \
|
||||
--subnets 'subnet-1:172.16.0.0:12,subnet-2:192.168.0.0:29' \
|
||||
--management-endpoint=https://management.database.windows.net:8443/ \
|
||||
--virtual-network-name v-net --affinity-group-name test \
|
||||
--virtual-network-name v-net --location 'West US' \
|
||||
--address-space '172.16.0.0/12,192.168.0.0/16'
|
||||
|
||||
EOT
|
||||
|
|
|
@ -16,7 +16,7 @@ module Puppet::VirtualNetwork
|
|||
def add_set_virtual_network_options(action)
|
||||
add_default_options(action)
|
||||
add_virtual_network_name_option(action)
|
||||
add_affinity_group_name_option(action)
|
||||
add_location_option(action)
|
||||
add_address_space_option(action)
|
||||
add_subnet_option(action)
|
||||
add_dns_server_option(action)
|
||||
|
|
|
@ -15,7 +15,7 @@ describe Puppet::Face[:azure_vnet, :current] do
|
|||
azure_subscription_id: 'Subscription-id',
|
||||
management_endpoint: 'management.core.windows.net',
|
||||
virtual_network_name: 'login-name',
|
||||
affinity_group_name: 'AG1',
|
||||
location: 'West US',
|
||||
address_space: '172.16.0.0/12,10.0.0.0/8,192.168.0.0/24',
|
||||
dns_servers: 'dns-1:8.8.8.8,dns-2:8.8.4.4',
|
||||
subnets: 'subnet-1:172.16.0.0:12'
|
||||
|
@ -48,12 +48,12 @@ describe Puppet::Face[:azure_vnet, :current] do
|
|||
end
|
||||
end
|
||||
|
||||
describe '(affinity_group_name)' do
|
||||
it 'should validate the affinity group name' do
|
||||
@options.delete(:affinity_group_name)
|
||||
describe '(location)' do
|
||||
it 'should validate the location' do
|
||||
@options.delete(:location)
|
||||
expect { subject.set(@options) }.to raise_error(
|
||||
ArgumentError,
|
||||
/required: affinity_group_name/
|
||||
/required: location/
|
||||
)
|
||||
end
|
||||
end
|
||||
|
@ -72,11 +72,6 @@ describe Puppet::Face[:azure_vnet, :current] do
|
|||
end
|
||||
|
||||
describe 'optional parameter validation' do
|
||||
before :each do
|
||||
vnet_service.any_instance.stubs(:create_affinity_group).with(
|
||||
any_parameters
|
||||
)
|
||||
end
|
||||
|
||||
describe '(subnets)' do
|
||||
it 'subnets should be optional' do
|
||||
|
|
Загрузка…
Ссылка в новой задаче