cookbook 'windows_network', '= 0.1.0'
windows_network (5) Versions 0.1.0 Follow24
Configures windows network interfaces
cookbook 'windows_network', '= 0.1.0', :supermarket
knife supermarket install windows_network
knife supermarket download windows_network
windows_network Cookbook
This cookbook will configure the network interfaces on Windows
Requirements
This cookbook needs a data bag called 'servers' with an item called <hostname>.
It also uses win_domain for fallback information.
data bag servers <hostname>
{
"id": "mycomputername",
"interfaces": [
{
"name": "Local network",
"mac": "00:AC:21:BC:F0:E0",
"address": "10.1.0.123",
"netmask": "255.255.255.0",
"gateway": "10.1.0.1",
"dns-nameservers": "10.1.0.231,10.111.0.231",
"dns-search": "mydomain.local"
}
]
}
or
{
"id": "mycomputername",
"interfaces": [
{
"name": "Local network",
"address": "dhcp"
}
]
}
Environment
{
"name": "office",
"override_attributes": {
"win_domain": {
"DNS1": "10.1.0.231",
"DNS2": "10.1.0.231",
"DomainDNSName": "mydomain.local"
}
}
}
Usage
- Include cookbook in recipe:
recipe/default.rb
include_recipe "windows_network"
- Include version in metadata:
metadata.rb
depends 'windows_network', '>= 0.1.0'
- Add data bag servers <hostname> as under the requirements section
- (optional) Add Environment variables under win_domain
Notes
- If there is only one NIC and only one config in the data bag, then this config will be used.
- If there is only one NIC and only one config in the data bag, then the mac entry can be omitted.
- You can specify "dhcp" as address and the NIC will be configure for DHCP.
Todo
- Handle multiple IP addresses per interface
- Handle routes per interface
Contributing
- Fork the repository on Github
- Create a named feature branch (i.e.
add-new-recipe
) - Write you change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
License and Authors
Authors: Christoffer Järnåker, Proxmea BV
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
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
CHANGELOG for windows_network
This file is used to list changes made in each version of sbp_win_ip.
0.1.0:
- Initial release of windows_network
Check the Markdown Syntax Guide for help with Markdown.
The Github Flavored Markdown page describes the differences between markdown on github and standard markdown.
Foodcritic Metric
0.1.0 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:13
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:26
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:27
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:31
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:36
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:37
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:205
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:208
FC019: Access node attributes in a consistent manner: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:15
FC019: Access node attributes in a consistent manner: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:207
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:99
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:105
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:140
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:142
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:175
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:178
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:211
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:220
0.1.0 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:26
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:27
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:31
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:36
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:37
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:205
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:208
FC019: Access node attributes in a consistent manner: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:15
FC019: Access node attributes in a consistent manner: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:207
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:99
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:105
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:140
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:142
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:175
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:178
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:211
FC048: Prefer Mixlib::ShellOut: /tmp/cook/3e7a7992cb4c832f8e963028/windows_network/recipes/default.rb:220