Closed mikej888 closed 1 year ago
Hi @mikej888 ,
I'm a bit confused by this. The error message indicates that Vault isn't initialised, but you mention
Remove task to initialise Vault, as it's already initialised.
the unseal task set is also only accessible via the init task set, so it follows that Vault must have been initialised for ansible to get to the unseal.yml tasks.
if it's a timing issue (i.e. ansible making the unseal request too quickly after vault is initialised) then I suppose we can just add a step to pause for 5-10 seconds to wait for it. @JossWhittle any thoughts?
Hi @alee-x, I found the message contradictory too. It happened a few times. However, rerunning the playbook as-is definitiely failed as it complained that the Vault was already initialised.
I searched for '"Error unsealing" "Vault is not initialized"' and found that others have had comparable issues...
However, nothing springs out as being a satisfactory explanation with a solution. The Vault version that was installed is 1.13.1.
Fixed by @alee-x in #106, #107, #108, #109.
Issue encountered while running DARE-SeRP-Dev-Deployment Version: 43f688f (Thu Sep 14 17:15:42 2023 +0100)
main
branch.Running
monolithic_mk8s_example/1-vm-setup-and-deploy.yaml
sometimes failed at:A workaround that has worked is the following. Back up
dare.common
collectionvault_init_config
roleinit.yml
task:Edit
~/.ansible/collections/ansible_collections/dare/common/roles/vault_init_config/tasks/init.yml
tooutput/vault/root-unseal.json
from the Ansible control node (these correspond to the outputs of the Vault initialisation). i.e.:set_fact: vault_init: "{{ lookup('file', vault_config_output_folder + '/root-unseal.json') | from_json }}"
include_tasks: unseal.yml loop: "{{ vault_pods|flatten(levels=1) }}" loop_control: loop_var: pod_name
Rerun playbook:
It would be good to include some check to ensure that no attempt is made to unseal the Vault until it has initialised.