본문 바로가기

리눅스

[iac][ansible] ansible-vault 명령

728x90

ansible-vault 명령

ansible-vault create a.yaml
ansible-vault view a.yaml
$ ansible-vault view a.yaml
Vault password:
---
- hosts: node1
  tasks:
  - ping:
ansible-vault edit a.yaml
$ ansible-vault edit a.yaml
Vault password:
 ---
 - hosts: node1
   tasks:
   - ping:
ansible-playbook a.yaml -i ../inventory.ini --ask-vault-pass
$ ansible-playbook a.yaml -i ../inventory.ini --ask-vault-pass
Vault password:

PLAY [node1] ******************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************
ok: [node1]

TASK [ping] *******************************************************************************************************
ok: [node1]

PLAY RECAP ********************************************************************************************************
node1                      : ok=2    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0
728x90