Added manifest for storage account and update readme.
This commit is contained in:
Родитель
ca7352f448
Коммит
204fb22eb8
|
@ -21,9 +21,14 @@ This module requires Puppet 2.7.2 or later.
|
|||
* via xml file
|
||||
|
||||
* SQL Database Server Management
|
||||
* list, create, list sqldb servers & password reset for a sqldb server
|
||||
* list, set, delete firewall rules for a sqldb server
|
||||
* list, create, list sqldb servers & password reset for a sqldb server
|
||||
* list, set, delete firewall rules for a sqldb server
|
||||
|
||||
* Storage Account Management
|
||||
* create, delete, update and list storage accounts.
|
||||
|
||||
* Cloud Service Management
|
||||
* create, delete, upload_certificate and list cloud services
|
||||
|
||||
Getting Started
|
||||
===============
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
class windowsazure::storage (
|
||||
$azure_management_certificate,
|
||||
$azure_subscription_id,
|
||||
$storage_account_name,
|
||||
$description = undef,
|
||||
$label = undef,
|
||||
$location = undef,
|
||||
$affinity_group_name = undef
|
||||
) {
|
||||
|
||||
Exec { path => ['/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/'] }
|
||||
|
||||
$cmd = "puppet azure_storage create --storage-account-name ${storage_account_name} --management-certificate ${azure_management_certificate} --azure-subscription-id ${azure_subscription_id}"
|
||||
|
||||
if $azure_management_certificate == undef {
|
||||
fail('Specify azure management certificate path.')
|
||||
}
|
||||
|
||||
if $azure_subscription_id == undef {
|
||||
fail('Specify subscription id.')
|
||||
}
|
||||
|
||||
if $storage_account_name == undef {
|
||||
fail('Storage account name is not specified for storage account.')
|
||||
}
|
||||
|
||||
if $label != undef {
|
||||
$lbl = "--label ${label}"
|
||||
}
|
||||
|
||||
if $description != undef {
|
||||
$desc = "--description ${description}"
|
||||
}
|
||||
|
||||
if $affinity_group_name != undef {
|
||||
$agn = "--affinity-group-name ${affinity_group_name}"
|
||||
}
|
||||
|
||||
if $storage_account_name != undef {
|
||||
$sac = "--storage-account-name ${storage_account_name}"
|
||||
}
|
||||
|
||||
if $location != undef {
|
||||
$loc = "--location '${location}'"
|
||||
}
|
||||
|
||||
$puppet_command = "${cmd} ${lbl} ${desc} ${sac} ${agn} ${loc}"
|
||||
|
||||
if !defined( Package['azure'] ) {
|
||||
package { 'azure':
|
||||
ensure => '0.6.4',
|
||||
provider => 'gem',
|
||||
}
|
||||
}
|
||||
|
||||
exec {"Storage Account":
|
||||
command => $puppet_command,
|
||||
logoutput => true,
|
||||
}
|
||||
|
||||
Package['azure'] -> Exec['Storage Account']
|
||||
|
||||
}
|
Загрузка…
Ссылка в новой задаче