openstack-ansible-lxc_hosts/templates/prep-scripts/_container_sys_setup.sh.j2
Jonathan Rosser 4614d7fd1a Fix lxc image preparation for bionic
Ensure that the devices required for apt are present. Ensure
that the required directories for gpg-agent are present. Ensure
that the gpg-agent is running.

Change-Id: Iaa82d44c041ca5f83e6ba7b99af3dfacef8af369
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-08-04 11:31:53 +01:00

31 lines
935 B
Django/Jinja

# System containers will require mount points for the following
mkdir -p /dev
mkdir -p /proc
mkdir -p /sys/fs/cgroup
mkdir -p /dev/pts
#gnupg requires this
mkdir -p /root/.gnupg
# 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
for i in {0..5}; do
[ ! -e "/dev/pts/$i" ] && mknod -m 0666 "/dev/pts/$i" c 136 $i
done
[ ! -e /dev/pts/ptmx ] && mknod -m 0666 /dev/pts/ptmx c 5 2
# 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 %}