ansible collections - Collection level variable

1.8k Views Asked by At

Is there a way to provide variables at collection level. So that all roles in this collection can access the variable?

Example Usecase: A collection with multiple roles for a company. Many roles need a default network storage location.

Possible workarounds:

  1. Having a role that all other roles in the collection depend upon that calls set_fact
  2. Setting facts on the instances
1

There are 1 best solutions below

1
On

Put your variables in playbooks/group_vars/all.yml