-
Notifications
You must be signed in to change notification settings - Fork 4
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
Allow default template to add custom attributes #8
Open
dnlloyd
wants to merge
4
commits into
ovaistariq:master
Choose a base branch
from
dnlloyd:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
if node['multipath']['storage_type'] == "customized" | ||
default['multipath']['defaults']['user_friendly_names'] = "yes" | ||
default['multipath']['defaults']['find_multipaths'] = "yes" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Template dropped by Chef for <%= node["fqdn"] %> | ||
# Local modifications will be overwritten | ||
|
||
defaults { | ||
<% node["multipath"]["defaults"].each do |param,param_value| -%> | ||
<%= param %> <%= param_value %> | ||
<% end -%> | ||
} | ||
|
||
blacklist { | ||
<% node["multipath"]["blacklist_wwid"].each do |bl_wwid| -%> | ||
wwid <%= bl_wwid %> | ||
<% end -%> | ||
<% node["multipath"]["blacklist_regex"].each do |bl_device| -%> | ||
devnode "<%= bl_device %>" | ||
<% end -%> | ||
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*" | ||
devnode "^hd[a-z][[0-9]*]" | ||
devnode "^cciss!c[0-9]d[0-9]*[p[0-9]*]" | ||
} | ||
|
||
<% unless node["multipath"]["aliases"].empty? -%> | ||
multipaths { | ||
<% node["multipath"]["aliases"].each do |alias_def| -%> | ||
<% alias_arr = alias_def.split(/:/) -%> | ||
multipath { | ||
wwid <%= alias_arr[1] %> | ||
alias <%= alias_arr[0] %> | ||
} | ||
<% end -%> | ||
} | ||
<% end -%> | ||
|
||
devices { | ||
<% node["multipath"]["devices"].each do |product,parameters| %> | ||
device { | ||
product "<%= product %>" | ||
<% parameters.each do |param,param_value| %> | ||
<%= param %> <%= param_value %> | ||
<% end -%> | ||
} | ||
<% end -%> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/usr/bin/env bats | ||
|
||
@test 'multipath configuration sets default user_friendly_names to yes' { | ||
grep -A 1 "defaults {" /etc/multipath.conf |grep "user_friendly_names yes" | ||
} | ||
|
||
@test 'multipath configuration sets default find_multipaths to yes' { | ||
grep -A 2 "defaults {" /etc/multipath.conf |grep "find_multipaths yes" | ||
} | ||
|
||
@test 'multipath configuration sets default queue_without_daemon to no' { | ||
grep -A 3 "defaults {" /etc/multipath.conf |grep "queue_without_daemon no" | ||
} | ||
|
||
@test 'multipath configuration sets default max_fds to max' { | ||
grep -A 4 "defaults {" /etc/multipath.conf |grep "max_fds max" | ||
} | ||
|
||
@test 'multipath configuration sets device product to OPEN-d*' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep "product[[:space:]][[:punct:]]OPEN-d" | ||
} | ||
|
||
@test 'multipath configuration sets OPEN-d* device vendor to HP' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 1 "product[[:space:]][[:punct:]]OPEN-d" |grep "vendor[[:space:]][[:punct:]]HP" | ||
} | ||
|
||
@test 'multipath configuration sets OPEN-d* device path_grouping_policy to multibus' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 2 "product[[:space:]][[:punct:]]OPEN-d" |grep "path_grouping_policy[[:space:]]multibus" | ||
} | ||
|
||
@test 'multipath configuration sets OPEN-d* device rr_min_io to 1000' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 3 "product[[:space:]][[:punct:]]OPEN-d" |grep "rr_min_io[[:space:]]1000\>" | ||
} | ||
|
||
@test 'multipath configuration sets device product to HSV200' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep "product[[:space:]][[:punct:]]HSV200" | ||
} | ||
|
||
@test 'multipath configuration sets HSV200 device vendor to HP' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 1 "product[[:space:]][[:punct:]]HSV200" |grep "vendor[[:space:]][[:punct:]]HP" | ||
} | ||
|
||
@test 'multipath configuration sets HSV200 device path_grouping_policy to group_by_prio' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 2 "product[[:space:]][[:punct:]]HSV200" |grep "path_grouping_policy[[:space:]]group_by_prio" | ||
} | ||
|
||
@test 'multipath configuration sets HSV200 device rr_min_io to 1000' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 3 "product[[:space:]][[:punct:]]HSV200" |grep "rr_min_io[[:space:]]100\>" | ||
} | ||
|
||
@test 'multipath configuration sets device product to Invista' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep "product[[:space:]][[:punct:]]Invista" | ||
} | ||
|
||
@test 'multipath configuration sets Invista device vendor to EMC' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 1 "product[[:space:]][[:punct:]]Invista" |grep "vendor[[:space:]][[:punct:]]EMC" | ||
} | ||
|
||
@test 'multipath configuration sets Invista device path_grouping_policy to multibus' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 2 "product[[:space:]][[:punct:]]Invista" |grep "path_grouping_policy[[:space:]]multibus" | ||
} | ||
|
||
@test 'multipath configuration sets Invista device product_blacklist to LUNZ' { | ||
grep -A 4 "device {" /etc/multipath.conf |grep -A 3 "product[[:space:]][[:punct:]]Invista" |grep "product_blacklist[[:space:]][[:punct:]]LUNZ\>" | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think it would be better to put this inside of a hash rather than using the if matching here.
ex:
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.
The logic was left-over from a previous iteration I had and I forgot to remove it. I think it would suffice to just remove the logic, don't you?