Can I pass prompt variable to all of included playbooks?

My case is:

  1. I have a main.yml which includes A.yml and B.yml.
  2. A.yml and B.yml have different hosts.
  3. I have a password which is used in A.yml and B.yml.

I want to use vars_prompt to set password and my expectation is only to prompt once to input password. But I didn’t find out the solution.
If I set vars_prompt in mainl.yml, A.yml and B.yml cannot get the variable.
It seems that I must set vars_prompt in both A.yml and B.yml. It means I have to input the same password twice.

Anybody knows how to implement my case with prompt once? Thank you!

We would have to make some changes to make vars_prompt global.

Generally I'm *not* a fan of vars_prompt because it's interactive.
A better option is "--extra-vars", which sets global variables for all
playbooks.

You could also use a wrapper script, or read environment variables to
achieve similar ends.

Thank you.