-
Notifications
You must be signed in to change notification settings - Fork 8
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 #39 from stackhpc/feature/etc-hosts
Adds etc-hosts element
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
========= | ||
etc-hosts | ||
========= | ||
Appends text to /etc/hosts. | ||
|
||
`DIB_ETC_HOSTS_EXTRA`: Lines to add to /etc/hosts | ||
|
||
For example: | ||
|
||
.. code-block:: | ||
export DIB_ETC_HOSTS_EXTRA="192.168.20.1 compute-host-01" | ||
Or: | ||
|
||
export DIB_ETC_HOSTS_EXTRA=`cat ./my-hosts` |
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,3 @@ | ||
#!/bin/bash | ||
|
||
export ETC_HOSTS_EXTRA=${DIB_ETC_HOSTS_EXTRA:?"You must define DIB_ETC_HOSTS_EXTRA"} |
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,9 @@ | ||
#!/bin/bash | ||
|
||
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then | ||
set -x | ||
fi | ||
set -eu | ||
set -o pipefail | ||
|
||
printf "$ETC_HOSTS_EXTRA" >> /etc/hosts |