Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jkordish/4567653 to your computer and use it in GitHub Desktop.
Save jkordish/4567653 to your computer and use it in GitHub Desktop.
added system() to have the disk being selected for swift skip over my fc storage
default["swift"]["disk_test_filter"] = [ "candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not system('/bin/grep FAStT ' + '/sys/block/' + candidate + '/device/model')",
"info['removable'] == 0.to_s"
]
@jkordish
Copy link
Author

To make it more permanent you could also edit the rpcs file and ensure something like the following.

# knife environment edit rpcs

"override_attributes": {
"swift": {
"disk_test_filter": [
"candidate =~ /sd[^a]/ or candidate =~ /hd[^a]/ or candidate =~ /vd[^a]/ or candidate =~ /xvd[^a]/",
"File.exist?('/dev/' + candidate)",
"not system('/sbin/parted /dev/' + candidate + ' -s print | grep linux-swap')",
"not system('/bin/grep FAStT ' + '/sys/block/' + candidate + '/device/model')",
"info['removable'] == 0.to_s"
],
},

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment