role variables

Anybody knows passing solution vars_files in dependencies role

i have variable files located in vars dir but i tried to pass vars_files in this play but its not working any solution to solve this issues .

now passing var like this vars:
aws_efs_paths:

  • { path: “/iphare”, owner: “root”, group: “root”, mode: “0644”, region: “hello-1”, filesystem_id: “hdk-hfksd-lf”} but i have vars file with different env in vars passing this to all playbook is difficult .

dependencies:

  • role: nfs
    vars:
    aws_efs_paths:
  • { path: “/iphare”, owner: “root”, group: “root”, mode: “0644”, region: “hello-1”, filesystem_id: “hdk-hfksd-lf”}

It's hard to overwrite vars variable in roles, check the precedence here
https://docs.ansible.com/ansible/latest/user_guide/playbooks_variables.html#variable-precedence-where-should-i-put-a-variable

Instead of using vars in the role use defaults, and you can overwrite them everywhere.

Thank you, Kai Stain Olstad i will check that