-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1571 from jrha/hostsfile_ipv6
ncm-hostsfile: Test IPv6 and dual stack localhosts
- Loading branch information
Showing
6 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
ncm-hostsfile/src/main/pan/components/hostsfile/config-common.pan
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,33 @@ | ||
# ${license-info} | ||
# ${developer-info} | ||
# ${author-info} | ||
# ${build-info} | ||
|
||
unique template components/${project.artifactId}/config-common; | ||
|
||
include 'components/${project.artifactId}/schema'; | ||
|
||
# Set prefix to root of component configuration. | ||
prefix '/software/components/${project.artifactId}'; | ||
|
||
'version' = '${no-snapshot-version}'; | ||
'active' ?= false; | ||
'dispatch' ?= false; | ||
|
||
# Provide variables which can be used to provide dual stack entries for localhost. | ||
# Specifying aliases for both stacks allows localhost to resolve for both protocols | ||
# while still avoiding duplicate entries. | ||
|
||
final variable HOSTSFILE_LOCALHOST4 = dict( | ||
'localhost', dict( | ||
'ipaddr', '127.0.0.1', | ||
'aliases', 'localhost.localdomain localhost4 localhost4.localdomain4', | ||
), | ||
); | ||
|
||
final variable HOSTSFILE_LOCALHOST6 = dict( | ||
'localhost6', dict( | ||
'ipaddr', '::1', | ||
'aliases', 'localhost localhost.localdomain localhost6.localdomain6', | ||
), | ||
); |
8 changes: 8 additions & 0 deletions
8
ncm-hostsfile/src/main/pan/components/hostsfile/config-rpm.pan
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,8 @@ | ||
# ${license-info} | ||
# ${developer-info} | ||
# ${author-info} | ||
# ${build-info} | ||
|
||
unique template components/${project.artifactId}/config-rpm; | ||
|
||
"/software/packages" = pkg_repl("ncm-${project.artifactId}", "${no-snapshot-version}-${rpm.release}", "noarch"); |
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,16 @@ | ||
object template dual_stack_localhost; | ||
|
||
include 'components/hostsfile/config-common'; | ||
|
||
prefix '/software/components/hostsfile'; | ||
|
||
'active' = true; | ||
'file' = '/tmp/hosts.local'; | ||
'takeover' = true; | ||
'entries' ?= dict(); | ||
|
||
# IPv4 | ||
'entries' = merge(SELF, HOSTSFILE_LOCALHOST4); | ||
|
||
# IPv6 | ||
'entries' = merge(SELF, HOSTSFILE_LOCALHOST6); |
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,11 @@ | ||
object template ipv6; | ||
|
||
include 'components/hostsfile/config-common'; | ||
|
||
prefix '/software/components/hostsfile'; | ||
|
||
'active' = true; | ||
'file' = '/tmp/hosts.local'; | ||
'entries' ?= dict(); | ||
|
||
'entries' = merge(SELF, HOSTSFILE_LOCALHOST6); |