Skip to content

Instantly share code, notes, and snippets.

@libert-xyz
Created April 4, 2017 22:11
Show Gist options
  • Save libert-xyz/d34a2be702db66fdde365cb7fa553b25 to your computer and use it in GitHub Desktop.
Save libert-xyz/d34a2be702db66fdde365cb7fa553b25 to your computer and use it in GitHub Desktop.
ansible folder to base64
#! /bin/sh
ansible_configuration=$1
shift
cat <<-EOF
#! /bin/bash
set -o errexit
mkdir -p /tmp/ansible
echo '$(tar c -C "$ansible_configuration" . | gzip -n | base64 -w 0)' | base64 -d | tar xz -C /tmp/ansible
cd /tmp/ansible
EOF
echo -n '/usr/bin/ansible-playbook playbook.yml --connection=local -i hosts'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment