티스토리 뷰

DevOps/Ansible

How to use Ansible Vault

빼인트 2019. 9. 11. 12:13

Changed how to use after version 2.5.

Ansible Version: 2.5 or later

Create a vault password file and encrypt using Openssl

# Create a plain text password file and input password
$ vi .vault_pass_org

# Encrypt a password file using OpenSSL
$ sudo openssl aes-256-cbc -salt -in .vault_pass_org -out .vault_pass
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:

Add option to ansible.cfg

[defaults]
vault_identity_list = files@./.vault_pass

Encrypt a variable file

$ ansible-vault encrypt secrets.yml

Ansible Version: Before 2.5

Create a vault password file

$ ansible-vault create .vault_pass

Add option to ansible.cfg

[defaults]
vault_password_file = ./.vault_pass

Encrypt a variable file

$ ansible-vault encrypt secrets.yml
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함