Is there a way to have both encrypted and nonencrypted host vars?

后端 未结 4 552
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-15 01:46

If I encrypt host_vars/* files with ansible-vault, I don\'t seem to have a chance to have nonencrypted host vars other than those residing in the inven

4条回答
  •  野性不改
    2021-02-15 02:36

    You can use this ansible feature : http://docs.ansible.com/ansible/playbooks_best_practices.html#best-practices-for-variables-and-vaults

    group_vars/ 
      san_diego/
        vars.yml  # unecrypted yaml file
        vault.yml # encrypted yaml file
    

    Ansible will read automatically vault.yml as encrypted yaml file.

提交回复
热议问题