-
-
Notifications
You must be signed in to change notification settings - Fork 476
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure Snapshot Repository #1087
base: master
Are you sure you want to change the base?
Changes from 1 commit
032c581
d17608e
0686a7f
66b3703
d40328d
ac38657
7a4a933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,30 @@ | |
newproperty(:location) do | ||
desc 'Repository location' | ||
end | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like |
||
newproperty(:client) do | ||
defaultto 'default' | ||
desc 'Azure client' | ||
end | ||
|
||
newproperty(:container) do | ||
defaultto 'elasticsearch-snapshots' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we should set a |
||
desc 'Azure storage container' | ||
end | ||
|
||
newproperty(:base_path) do | ||
desc 'Specifies the path within container to repository data.' | ||
end | ||
|
||
newproperty(:readonly) do | ||
defaultto 'false' | ||
desc 'Makes repository read-only.' | ||
end | ||
|
||
newproperty(:location_mode) do | ||
defaultto 'primary_only' | ||
desc 'primary_only or secondary_only. Note that if you set it to secondary_only, it will force readonly to true.' | ||
end | ||
|
||
newproperty(:chunk_size) do | ||
desc 'File chunk size' | ||
|
@@ -46,6 +70,10 @@ | |
end | ||
|
||
validate do | ||
raise ArgumentError, 'Location is required.' if self[:location].nil? | ||
if self[:type] == 'fs' | ||
raise ArgumentError, 'Location is required.' if self[:location].nil? | ||
elsif self[:type] == 'azure' | ||
raise ArgumentError, 'Container is required.' if self[:container].nil? | ||
end | ||
end | ||
end # of newtype |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,22 @@ | |
# Snapshot repository type. | ||
# | ||
# @param location | ||
# Location of snapshots. Mandatory | ||
# Location of snapshots. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This field is still mandatory when |
||
# | ||
# @param container | ||
# Azure Container name. | ||
# | ||
# @param client | ||
# Azure named client to use. | ||
# | ||
# @param base_path | ||
# Azure path within container to repository data. | ||
# | ||
# @param readonly | ||
# Makes Azure repository read-only. | ||
# | ||
# @param location_mode | ||
# Azure location_mode. | ||
# | ||
# @param compress | ||
# Compress the snapshot metadata files? | ||
|
@@ -60,8 +75,13 @@ | |
# @author Tyler Langlois <[email protected]> | ||
# | ||
define elasticsearch::snapshot_repository ( | ||
String $location, | ||
Optional[String] $location = undef, | ||
Enum['absent', 'present'] $ensure = 'present', | ||
Optional[String] $client = undef, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you sort out the alignment on these lines? Should all align on |
||
Optional[String] $container = undef, | ||
Optional[String] $base_path = undef, | ||
Optional[Boolean] $readonly = false, | ||
Optional[String] $location_mode = undef, | ||
Optional[String] $api_basic_auth_password = $elasticsearch::api_basic_auth_password, | ||
Optional[String] $api_basic_auth_username = $elasticsearch::api_basic_auth_username, | ||
Optional[Stdlib::Absolutepath] $api_ca_file = $elasticsearch::api_ca_file, | ||
|
@@ -88,6 +108,7 @@ | |
chunk_size => $chunk_size, | ||
compress => $compress, | ||
location => $location, | ||
location => $location, | ||
max_restore_rate => $max_restore_rate, | ||
max_snapshot_rate => $max_snapshot_rate, | ||
type => $repository_type, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These new fields will need to be added as
optional
fields on thegenerate_body
method below.