cookbook 'extended_drbd', '~> 1.0.5', :supermarket
extended_drbd (7) Versions 1.0.5 Follow1
DRBD recipe
cookbook 'extended_drbd', '~> 1.0.5'
knife supermarket install extended_drbd
knife supermarket download extended_drbd
extended_drbd
This cookbook is designed to setup and configure a pair of server with drbd. Please Note: this cookbook does not mount the drbd drive.
This cookbook assumes that you want it to control your firewall using iptables,
as such it will attempt to open/close the correct ports. If you want to disable
this functionality you can modify the attribute node['iptables']['enabled']
and set it to false
.
This cookbook can be used in the following situations:
1) Fresh server pair installation (please see below for how to use).
2) Adding a server to another server running drbd.
3) Change drbd.conf file and have drbd update with out restarting.
Usage
How to use when creating a fresh server pair:
Prerequisites:
Chef client must be installed on both servers.
The disk location
node['drbd']['disk']['location']
must exist.
Note: In order for this work properly both servers need to be running chef at the same time,
You will need to have the following attribute values specified:
node['drbd']['primary']['fqdn']
and node['drbd']['partner']['hostname']
Note: If you do not specify both attributes then the chef run will error out.
Once one server has been specified as drbd master you can add the recipe "drbd::drbd_fresh_install" to the run_list of both servers.
How to use when adding a new server to another server running drbd:
This is the same as above except the new server is not specified as the drbd master, and you dont have to be running chef-client on the other server.
How to use when changing the drbd.conf file:
On which ever server you are updated (or both) add the recipe "drbd::drbd_inplace_upgrade" to the server's run_list. And the next time Chef-client runs it will preform the changes in a safe way.
The way I have used this have been to call this drbd cookbook from within another cookbook, and have the second cookbook do the logic of decided whether or not this is a fresh install or inplace upgrade.
Here is how I use it:
if ::File.exists?("/etc/drbd.conf")
include_recipe "extended_drbd::drbd_inplace_upgrade"
else
include_recipe "extended_drbd::drbd_fresh_install"
end
Attributes:
default['drbd']['packages'] = ["kmod-drbd83", "drbd83"]
default['drbd']['disk']['location'] = "/dev/local/data"
default['drbd']['mount'] = "/data"
default_unless['drbd']['fs_type'] = "ext3"
default['drbd']['dev'] = "/dev/drbd0"
default['drbd']['master'] = false
default['drbd']['port'] = 7789
default['drbd']['configured'] = false
default['drbd']['syncrate'] = "36M"
default['drbd']['resource'] = "data"
default['drbd']['stop_file'] = "/etc/drbd_stop_file"
default['drbd']['synced']['stop_file'] = "/etc/drbd_synced_stop_file"
default['drbd']['initialized']['stop_file'] = "/etc/drbd_initialized_stop_file"
default['drbd']['primary']['fqdn'] = nil
- Fqdn of the primary drbd serverdefault['drbd']['server']['hostname'] = nil
- Fqdn of the server Note: This will use thenode['fqdn']
if not specified.default['drbd']['server']['ipaddress'] = nil
- Ipaddress of the server Note: This will usenode['ipaddress']
if nil.default['drbd']['partner']['hostname'] = nil
- Fqdn of the partner serverdefault['drbd']['partner']['ipaddress'] = nil
- Ipaddress of the parter server Note: If not specified chef will try to search the chef-server usingnode['drbd']['partner']['hostname']
to find the node object.default['drbd']['command_timeout'] = 36000
- A timeout value used when trying to create a filesystem of a huge data store.default['drbd']['protocol'] = 'C'
- The protocal used by the drbd app.default['drbd']['disk']['on_io_error_action'] = 'detach'
default['drbd']['disk']['disk-flushes'] = false
default['drbd']['disk']['md-flushes'] = false
default['drbd']['disk']['no-disk-barrier'] = false
default['drbd']['net']['enabled'] = false
default['drbd']['net']['sndbuf-size'] = '1M'
default['drbd']['net']['max-buffers'] = 8000
default['drbd']['net']['max-epoch-size'] = 8000
default['iptables']['enabled'] = true
Testing
This recipe includes a number of chefspec unit tests for this cookbook.
To execute the tests run rake
This also makes use of vagrant, and creates VM's to make use of the cookbook. Because this cookbook REQUIRES both serves to be running chef at the same time, there are a few manual steps involved with using Vagrant.
1) Create both VM's (one at a time).
2) Once both VM's are up and running, edit the Vagrant File: <BLOCKQUOTE><PRE> Existing file: def get_recipes() recipes = %w{ chef-solo-search minitest-handler extended_drbd_helper yum::epel yum::elrepo }
extended_drbd::drbd_fresh_install
}
</PRE></BLOCKQUOTE> Please change the file to look like: <BLOCKQUOTE><PRE> Ater changes: def get_recipes() recipes = %w{ chef-solo-search minitest-handler extended_drbd_helper yum::epel yum::elrepo extended_drbd::drbd_fresh_install } </PRE></BLOCKQUOTE>
3) Now run vagrant provision <server_name>
for both servers at the same time.
License and Author
Author:: Justin Witrick (github@thewitricks.com)
Copyright:: Justin Witrick.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Dependent cookbooks
wait >= 0.0.0 |
iptables >= 0.0.0 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
1.0.5 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.5 failed this metric
FC064: Ensure issues_url is set in metadata: extended_drbd/metadata.rb:1
FC065: Ensure source_url is set in metadata: extended_drbd/metadata.rb:1
FC066: Ensure chef_version is set in metadata: extended_drbd/metadata.rb:1
FC069: Ensure standardized license defined in metadata: extended_drbd/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: extended_drbd/resources/immutable_file.rb:1
FC075: Cookbook uses node.save to save partial node data to the chef-server mid-run: extended_drbd/recipes/drbd_fresh_install.rb:48
FC085: Resource using new_resource.updated_by_last_action to converge resource: extended_drbd/providers/immutable_file.rb:27
FC104: Use the :run action in ruby_block instead of :create: extended_drbd/recipes/drbd_fresh_install.rb:41
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.5 passed this metric
Publish Metric
1.0.5 passed this metric
Supported Platforms Metric
1.0.5 passed this metric
Testing File Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.5 failed this metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
1.0.5 failed this metric
FC064: Ensure issues_url is set in metadata: extended_drbd/metadata.rb:1
FC065: Ensure source_url is set in metadata: extended_drbd/metadata.rb:1
FC066: Ensure chef_version is set in metadata: extended_drbd/metadata.rb:1
FC069: Ensure standardized license defined in metadata: extended_drbd/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: extended_drbd/resources/immutable_file.rb:1
FC075: Cookbook uses node.save to save partial node data to the chef-server mid-run: extended_drbd/recipes/drbd_fresh_install.rb:48
FC085: Resource using new_resource.updated_by_last_action to converge resource: extended_drbd/providers/immutable_file.rb:27
FC104: Use the :run action in ruby_block instead of :create: extended_drbd/recipes/drbd_fresh_install.rb:41
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
No Binaries Metric
1.0.5 passed this metric
Publish Metric
1.0.5 passed this metric
Supported Platforms Metric
1.0.5 passed this metric
Testing File Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.5 failed this metric
FC065: Ensure source_url is set in metadata: extended_drbd/metadata.rb:1
FC066: Ensure chef_version is set in metadata: extended_drbd/metadata.rb:1
FC069: Ensure standardized license defined in metadata: extended_drbd/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: extended_drbd/resources/immutable_file.rb:1
FC075: Cookbook uses node.save to save partial node data to the chef-server mid-run: extended_drbd/recipes/drbd_fresh_install.rb:48
FC085: Resource using new_resource.updated_by_last_action to converge resource: extended_drbd/providers/immutable_file.rb:27
FC104: Use the :run action in ruby_block instead of :create: extended_drbd/recipes/drbd_fresh_install.rb:41
Run with Foodcritic Version 14.3.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any
1.0.5 passed this metric
Publish Metric
1.0.5 passed this metric
Supported Platforms Metric
1.0.5 passed this metric
Testing File Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.5 passed this metric
1.0.5 passed this metric
Testing File Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.0.5 failed this metric
1.0.5 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number