
These should be able to be common, with a dictionary added to select the right libpython version to install based on the OS release. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-lxc_container_create/+/839167 Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/838762 Change-Id: I2cb97a25237a0495ea8d9001d80d06b134b8e500
40 lines
1.1 KiB
Django/Jinja
40 lines
1.1 KiB
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 /dev/null c 1 3
|
|
chown 0666 /dev/null
|
|
[ ! -e /dev/random ] && mknod /dev/random c 1 8
|
|
chown 0666 /dev/random
|
|
[ ! -e /dev/urandom ] && mknod /dev/urandom c 1 9
|
|
chown 0666 /dev/urandom
|
|
ln -sf /proc/self/fd /dev/fd
|
|
|
|
for i in {0..5}; do
|
|
[ ! -e "/dev/pts/$i" ] && mknod "/dev/pts/$i" c 136 $i
|
|
chown 0666 "/dev/pts/$i"
|
|
done
|
|
# file check does not seem to work at all times
|
|
[ ! -e /dev/ptmx ] && mknod /dev/ptmx c 5 2 || true
|
|
chown 0666 /dev/ptmx
|
|
[ ! -e /dev/pts/ptmx ] && mknod /dev/pts/ptmx c 5 2
|
|
chown 0000 /dev/pts/ptmx
|
|
|
|
# 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 %}
|