When the IPv6 address is given to us from the contextualization
variables, use it and disable autoconfiguration.
(cherry picked from commit 7ffdd1fa30)
When the contextualization variables give us both IPv4 and IPv6
addresses, use both instead of expecting CONTEXT_FORCE_IPV4.
(cherry picked from commit e100dcc14c)
On RHEL and CentOS 7 host name is kept in /etc/hostname, so even if SET_HOSTNAME has a value, the machine was keeping localhost.localdomain as name. This way the hostname file gets overwritten with contextualization variable value. I'm supposing that file /etc/hostname will be existing in next releases too (OS_VERSION >= 7)
Strip leading and trailing hyphens in the resulting munged hostname.
Leading and trailing hyphens are not valid according to RFCs 952 and 1123.
(This problem surfaces immediately when using the default configuration of
OneFlow, since it names new VMs ending with a parenthesis.)
When setting the hostname from $SET_HOSTNAME, replace any characters
not allowed in hostnames (as specified in RFC 952) with a hyphen.
This is enables a VM template to safely use the VM's name as the
hostname (by setting the context variable SET_HOSTNAME=$NAME).
generate.sh is also modified so it copies the files from these
directories by default or use dir.$ENVIRONMENT if specified. For
example, use ENVIRONMENT=ec2 to copy the directories that end in .ec2:
ENVIRONMENT=ec2 ./generate.sh
base
base.ec2
base_deb
base_deb.ec2