Last active
April 26, 2019 13:27
-
-
Save dbalduini/919de4ee99f21e60ae2e23b440772b72 to your computer and use it in GitHub Desktop.
Ansible vault in docker
This file contains hidden or 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
param ( | |
[switch]$Decrypt = $false, | |
[switch]$Encrypt = $false, | |
[string]$Path | |
) | |
$Dir = $(pwd) | |
$Target = "/tmp" | |
$Image = "<my-image-with-ansible>" | |
$C = "view" | |
if ($Decrypt) { | |
$C = "decrypt" | |
} elseif ($Encrypt) { | |
$C = "encrypt" | |
} | |
$Path = $Path.replace("\", "/") | |
write-output "> ansible-vault $C $Path" | |
docker run --rm -it --entrypoint ansible-vault -w "/tmp" -v "${Dir}:${Target}" ${Image} $C $Path |
Author
dbalduini
commented
Apr 24, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment