Changing the key that Ansible vault uses to encrypt/decrypt a vault file is a fairly simplistic task. It simply involves using the rekey operator within the Ansible vault command-line context. In the following example, the rekey command syntax is shown:
#> ansible-vault rekey <file.yml>
Upon running the previous command, we will be prompted for the existing key and a new key. The output (if the rekey was a success) should look something like the following: