Details
-
Type:
New Feature
-
Status:
Fix Reviewed
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: Chef Client, Chef Solo
-
Labels:
Description
On Debian Wheezy (testing) and Ubuntu 11.10 and later releases for both, the "ifupdown" program can now take a "source" directive that reads interface stanzas from a specified file.
From the interfaces(5) man page (Ubuntu 11.10):
Lines beginning with "source" are used to include stanzas from other files, so configuration can be split into many files. The word "source" is followed by the path of file to be sourced. Shell wildcards can be used. (See wordexp(3) for details.)
This will require that users have their /etc/network/interfaces configuration set up to include a source line with the files they wish to include. This could be done with a wildcard, per the man page entry, e.g. "source interfaces.d/*". Such a thing could be handled with Chef::Util::FileEdit, but that seems heavy-handed.
The current ifconfig provider is RHEL specific. It would need to be moved to a new provider and the Chef::Platform default provider for RHEL-family set to use the new name (I propose redhat). Then this new provider would be appropriately named debian, and the default provider on Debian/Ubuntu.
The main issue I see with that implementation is that the Chef::Platform version specification does not allow setting "versions greater than..."
Debian bug resolving the request to add this feature (source directive):
Issue Links
Activity
| Field | Original Value | New Value |
|---|---|---|
| Component/s | Providers [ 10005 ] |
| Workflow | jira [ 15583 ] | New OSS [ 17795 ] |
| Assignee | Xabier de Zuazo [ zuazo ] |
| Status | Open [ 1 ] | Fix Provided [ 10002 ] |
| Component/s | Chef Client [ 10000 ] | |
| Component/s | Chef Solo [ 10001 ] |
| Status | Fix Provided [ 10002 ] | Reopened [ 4 ] |
| Workflow | New OSS [ 17795 ] | OSS: Product Management [ 26070 ] |
| Status | Reopened [ 4 ] | Open [ 1 ] |
| Status | Open [ 1 ] | Fix Provided [ 10002 ] |
| Assignee | Xabier de Zuazo [Onddo Labs] [ zuazo ] | Bryan McLellan [Opscode] [ btm ] |
| Status | Fix Provided [ 10002 ] | Fix Reviewed [ 10000 ] |
| Transition | Time In Source Status | Execution Times | Last Executer | Last Execution Date | |||||
|---|---|---|---|---|---|---|---|---|---|
|
9d 3h 7m | 1 | Bryan McLellan [Opscode] | 20/Feb/13 9:00 PM | |||||
|
19d 1h 41m | 1 | Bryan McLellan [Opscode] | 11/Mar/13 10:41 PM | |||||
|
325d 13h 7m | 2 | Xabier de Zuazo [Onddo Labs] | 01/Apr/13 12:21 AM | |||||
|
30d 18h 23m | 1 | Steven Danna | 01/May/13 6:45 PM |
I know this patch may cause controversy, don't worry
Here's my first attempt.
https://github.com/opscode/chef/pull/635
Any ideas to improve the patch, problems or questions?
Some notes:
I reused Chef::Version and integrated it with Chef::Platform to support ">=" in platform versions.Maybe not quite fit: the exception Chef::Version throws is called InvalidCookbookVersion, perhaps this should be changed.By the way: this exception is ignored inside Chef::Platform.I also changed Chef::Version to support single digit in version names (for example cookbook version "1"), it is possible that you do not agree with this, but my idea is to try to reuse that class. IMHO not being able to make comparisons with single digit versions inside Chef::Platform would be weird, but it is not a requirement right now, so this change can be reverted.Deleted linesmove toCHEF-3919.