Why sosedoff/ansible-vault-go and not apenella/go-ansible
Cargoship’s Ansible Vault support (cargoship vault encrypt, and automatic decryption of vault-encrypted registry credentials at apply time) is built on github.com/sosedoff/ansible-vault-go. github.com/apenella/go-ansible was also considered, since it’s a more widely known Go/Ansible integration, but it isn’t a fit for this use case:
- No decrypt support.
go-ansible’svault/encryptpackage only exports anEncryptStringtype – there is noDecrypt/DecryptStringanywhere in the module. Decryption is Cargoship’s actual requirement:applyhas to transparently decrypt registry credentials on every run. - It wraps the same library anyway.
go-ansible’sEncryptStringusessosedoff/ansible-vault-gointernally for the crypto. Depending ongo-ansiblefor encryption would still pull insosedoff/ansible-vault-goas a transitive dependency, plusspf13/aferoandgo-ansible’s own password-reader abstraction – more surface area to replace logic Cargoship already has inResolveVaultPassword(internal/clustercfg/vault.go), for no functional gain. - Wrong shape of library.
go-ansible’s primary purpose is wrappingansible-playbook/ansible/ansible-galaxyCLI execution as subprocesses. Cargoship needs neither Ansible nor Python installed on the machine runningapplyorvault encrypt–sosedoff/ansible-vault-gois a native Go implementation of the vault cipher, so encrypting and decrypting single string values stays a pure in-process operation, consistent with Cargoship shipping as a single static binary.
Net effect: switching would add a heavier, partially-redundant dependency, lose decrypt support outright, and reimplement functionality sosedoff/ansible-vault-go already provides directly.