To deploy this charm and reproduce its behaviour:
git clone https://gist.github.com/jnsgruk/322c0058e361255fd7a529dc8fd6d196.git machine-charm
cd machine-charm
# Make the charm code executable
chmod +x charm.py
# Build the charm
charmcraft pack -e charm.py
# Deploy the charm
juju deploy ./machine-charm.charm