Use several vault IDs with a prompt
Mix vault IDs: a password file for dev and a prompt for prod, so each environment has its own secrets
ansible-playbook site.yml --vault-id dev@dev_pass.txt --vault-id prod@prompt
- tool
- ansible56 commands
More ansible commands
-
EDITOR=vim ansible-vault edit group_vars/prod/secrets.yml --vault-password-file ~/.vault_passDecrypt, edit in $EDITOR and encrypt again in one step; the decrypted temp file is removed when you close the editor
-
ansible-inventory -i aws_ec2.yml --graph --varsShow the cloud inventory tree with host vars; check the plugin grouping before a run
-
ansible-inventory -i aws_ec2.yml --list --yaml > resolved_inventory.ymlTurn a dynamic inventory into static YAML for diffs or offline debugging
-
plugin: constructed keyed_groups: - key: tags.Role prefix: role - key: placement.region prefix: regionBuild host groups from facts or tags with the constructed plugin, for example role_web, region_eu
-
molecule init role my_role --driver-name docker && cd my_role && MOLECULE_DISTRO=ubuntu2204 molecule createCreate a role with a Molecule scenario; MOLECULE_DISTRO picks the test image