openstack-ansible-lxc_hosts/templates/prep-scripts/_container_sys_setup.sh.j2
Mohammed Naser 030c348117 Setup /dev/random and /dev/urandom device in cache prep
In the cache preparation stage, there are certain libraries that
depend on the existance of /dev/random and /dev/urandom in order
to be able to function correctly, such as NSS in the latest CentOS
release (7.5)

This patch adds those nodes so that the libraries are able to use
them with no problems, allowing yum and rpm specifically to work
properly again.

Change-Id: Iaf6b9cb1435591f28289493f480a7fe46789c551
2018-05-10 18:02:28 +00:00

22 lines
722 B
Django/Jinja

# System containers will require mount points for the following
mkdir -p /dev
mkdir -p /proc
mkdir -p /sys/fs/cgroup
# In order for the package manager to function /dev/null, /dev/random and
# /dev/urandom must exist. This is is being run here because some images do not
# create /dev/null by default.
[ ! -e /dev/null ] && mknod -m 0666 /dev/null c 1 3
[ ! -e /dev/random ] && mknod -m 0666 /dev/random c 1 8
[ ! -e /dev/urandom ] && mknod -m 0666 /dev/urandom c 1 9
# Create the directory where local facts will be stored
mkdir -p /etc/ansible/facts.d
# Create the cache resolvers
rm /etc/resolv.conf || true
{% for resolver in lxc_cache_prep_dns %}
echo "nameserver {{ resolver }}" >> /etc/resolv.conf
{% endfor %}