0%

RHCE (EX294) - 创建密码库

创建密码库

按照下方所述,创建一个 Ansible 库来存储用户密码:

库名称为 /home/greg/ansible/locker.yml

库中含有两个变量,名称如下:

pw_developer,值为 Imadev

pw_manager,值为 Imamgr

用于加密和解密该库的密码为 whenyouwishuponastar

密码存储在文件 /home/greg/ansible/secret.txt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
[greg@control ansible]$ vim /home/greg/ansible/secret.txt
whenyouwishuponastar
[greg@control ansible]$ chmod 400 /home/greg/ansible/secret.txt
[greg@control ansible]$ vim ansible.cfg
...
# If set, configures the path to the Vault password file as an alternative to
# specifying --vault-password-file on the command line.
vault_password_file = /home/greg/ansible/secret.txt
...
[greg@control ansible]$ ansible-vault create /home/greg/ansible/locker.yml
pw_developer: Imadev
pw_manager: Imamgr
[greg@control ansible]$ ansible-vault view locker.yml
pw_developer: Imadev
pw_manager: Imamgr