Created
April 18, 2021 14:12
-
-
Save grafoo/115627eaa72bbaf45a3a39484401bf4a to your computer and use it in GitHub Desktop.
Make use of the Master the Mainframe Ansible challenge playbooks on LinuxONE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo dnf -y install ansible podman jq | |
podman save docker.io/masterthemainframe/ansible >masterthemainframe-ansible-image.tar | |
mkdir tmp-tarballs | |
tar -xf masterthemainframe-ansible-image.tar -C tmp-tarballs | |
mkdir tmp-rootfs | |
podman inspect docker.io/masterthemainframe/ansible | | |
jq '.[0]["RootFS"]["Layers"][]' | | |
cut -d: -f2|tr -d '"' | | |
while read -r layer; do | |
sudo tar -xf "tmp-tarballs/${layer}.tar" -C tmp-rootfs | |
done | |
sudo chown $(id -u):$(id -g) -R tmp-rootfs/root | |
chmod +w tmp-rootfs/root | |
mv tmp-rootfs/root ansb | |
sudo rm -rf masterthemainframe-ansible-image.tar tmp-tarballs tmp-rootfs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment