Enable debug
- debug:
msg: "commands to print"
Ansible dry run with limit
--check --diff --limit hosts
Enable debug
- debug:
msg: "commands to print"
Ansible dry run with limit
--check --diff --limit hosts
Default Ubunt image from Docker does not come with Timezone data. Installation of the package prompts for input, and this can be problematic for automated installation. This also cause issue when installing Python 3.9 on Docker image.
Create Timezone file and /etc/localtime link prior to installation
apt update
echo "Europe/London" > /etc/timezone
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime
apt install -y tzdata
apt update ; apt install -y python3.9 python3-pip
Installing Python 3.9 with TimeZone non-interactively
apt update
#Setup Timezone package. Not installed by default on Ubuntu, and will cause prompt when trying to install python 3.9
echo "Europe/London" > /etc/timezone
ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime
apt install -y tzdata
#Install required version of Python. installed in /usr/bin
apt install -y python3.9 python3-pip
#Pip3 creates a link called python3 in /usr/bin This link determines which Python3 it works with. So repoint it to version required.
[[ -f /usr/bin/python3 ]] && rm -f /usr/bin/python3
#Linking python3 to python3.9
ln -s /usr/bin/python3.9 /usr/bin/python3