We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a6b7b34 + 1522b7d commit 13a944eCopy full SHA for 13a944e
3 files changed
elements/etc-hosts/README.rst
@@ -0,0 +1,16 @@
1
+=========
2
+etc-hosts
3
4
+Appends text to /etc/hosts.
5
+
6
+`DIB_ETC_HOSTS_EXTRA`: Lines to add to /etc/hosts
7
8
+For example:
9
10
+ .. code-block::
11
12
+ export DIB_ETC_HOSTS_EXTRA="192.168.20.1 compute-host-01"
13
14
+Or:
15
16
+ export DIB_ETC_HOSTS_EXTRA=`cat ./my-hosts`
elements/etc-hosts/environment.d/etc-hosts
@@ -0,0 +1,3 @@
+#!/bin/bash
+export ETC_HOSTS_EXTRA=${DIB_ETC_HOSTS_EXTRA:?"You must define DIB_ETC_HOSTS_EXTRA"}
elements/etc-hosts/pre-install.d/01-etc-hosts
@@ -0,0 +1,9 @@
+if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
+ set -x
+fi
+set -eu
+set -o pipefail
+printf "$ETC_HOSTS_EXTRA" >> /etc/hosts
0 commit comments