build.sh (1264B)
1 #!/bin/bash 2 set -exuo pipefail 3 4 #### WARNING: THIS SCRIPT IS INTENED TO BE RUN INSIDE OF A CONTAINER 5 6 7 # Print some debug info 8 id ; cat /proc/self/uid_map ; mount | grep cgroup || true 9 10 # Check the fact helpers before spending time on the container 11 contrib/test-fact-helpers.sh 12 13 # Hack to make podman adapt to being nested 14 rm -f /etc/containers/storage.conf 15 16 # Build our image 17 podman build -f Containerfile -t ansible-taler-test 18 19 # Run in background (-d) with systemd init 20 podman run \ 21 --privileged \ 22 --tmpfs /sys \ 23 --rm \ 24 --name ansible-taler-test \ 25 -d localhost/ansible-taler-test sh -c "id ; cat /proc/self/uid_map ; mount | grep cgroup; exec /usr/sbin/init --show-status" 26 27 # Print to log that container is running 28 podman ps 29 30 # TOFU SSH host keys (so we don't get user prompt) 31 echo "StrictHostKeyChecking=accept-new" > ~/.ssh/config 32 33 # Run our playbook(s) 34 # NOTE: Trailing comma is correct (and required) in agument for -i flag 35 ansible-playbook --verbose -i 127.0.0.1:22, --user root playbooks/setup.yml 36 37 echo -e ' 38 ############################# 39 ############################# 40 ############################# 41 ###### Setup finished. ###### 42 ############################# 43 ############################# 44 #############################'