附录 C. 创建加密的 credentials.yml 文件
本节论述了如何创建传递给 Ansible Automation Platform 安装程序的加密 credentials.yml 文件。
警告
使用的密码必须在 环境 A 和环境 B 间 匹配。
在初始 环境 B Ansible Automation Platform 环境中,
创建一个 credentials.yml 文件来存储加密凭证
$ cat credentials.yml
admin_password: my_long_admin_password pg_password: my_long_pg_password registry_password: my_long_registry_password
使用
ansible-vault
加密 credentials.yml 文件$ ansible-vault encrypt credentials.yml
New Vault password: Confirm New Vault password: Encryption successful
警告admin_password
和pg_password
凭据需要与 Ansible Automation Platform 1.2 Environment A 中使用的值匹配。警告确保将加密的 vault 密码存储在安全位置。
验证 credentials.yml 文件是否已加密
$ cat credentials.yml
$ANSIBLE_VAULT;1.1;AES256 36383639653562386534316333333961383336306465336465613831353435313530376464616539 3765393063303065323466663330646232363065316666310a373062303133376339633831303033 34313534383962613632303761636632623932653062343839613639653635643365616233313365 3636616639313864300a353239373433313339613465326339313035633565353464356538653631 63346434383534643237663862353361366632613634333231316334363939396461326561643336 3430633534303935646264633034383966336232303365383763
注意
加密凭证的创建是可选的,但建议在清单文件中存储密码不应以纯文本形式保存。
如果您已使用加密的 credentails,请使用 credentials.yml 文件,而不是创建新文件。