`--tags deploy` also ran a cleanup task tagged `always` and deleted the release directory
IntermediateTroubleshootingVault, Performance and Execution Behaviour
Answer
Likely causes → Tasks tagged always run for any --tags selection, and are skipped only with --skip-tags always. The never tag works the opposite way: those tasks run only when their other tag is requested explicitly.
Fix → Remove always from destructive tasks, and give them never plus an explicit tag:
- ansible.builtin.file:
path: /opt/app/releases/old
state: absent
tags: [never, cleanup]
Now it only runs with --tags cleanup.
Prevent → Keep always for fact-setting and validation tasks only. Review --list-tasks --tags <x> output before relying on a tag.
More on Vault, Performance and Execution Behaviour
`ERROR! Attempting to decrypt but no vault secrets found`Beginner`ERROR! Decryption failed (no vault secrets were found that could decrypt) on inventories/prod/group_vars/all/vault.yml`BeginnerBoth `--vault-id [email protected]` and `--vault-id prod@prompt` are passed, and prod files still fail to decryptIntermediate`Vault format unhexlify error: Odd-length string` after pasting an `encrypt_string` valueIntermediate`Problem running vault password script /home/ci/.vault_pass ([Errno 8] Exec format error). If this is not a script, remove the executable bit from the file.`AdvancedEvery change to `vault.yml` produces an unreadable diff and constant merge conflictsIntermediate