Guest User

Untitled

a guest
Aug 17th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. roles:
  2. - role: my_role
  3. vars:
  4. role_uuid: uuud_1
  5. first_param: first
  6. - role: my_role
  7. vars:
  8. role_uuid: uuid_2
  9. second_param: second
  10.  
  11. tasks:
  12. - include_role:
  13. name: my_role
  14. vars:
  15. role_uuid: uuud_1
  16. first_param: first
  17. - include_role:
  18. name: my_role
  19. vars:
  20. role_uuid: uuud_2
  21. second_param: second
  22.  
  23. tasks:
  24. - include_vars: "{{ role_id }}"
  25. - debug: msg="{{ role_id }}.first_param [ {{ first_param|default('undefined') }} ]"
  26. - debug: msg="{{ role_id }}.second_param [ {{ second_param|default('undefined') }} ]"
  27.  
  28. first_param: 'first'
  29.  
  30. second_param: 'second'
  31.  
  32. - hosts: localhost
  33. tasks:
  34. - include_role:
  35. name: my_role
  36. vars:
  37. role_id: 'id_1'
  38. - include_role:
  39. name: my_role
  40. vars:
  41. role_id: 'id_2'
  42.  
  43. "msg": "id_1.first_param [ first ]"
  44. "msg": "id_1.second_param [ undefined ]"
  45. "msg": "id_2.first_param [ undefined ]"
  46. "msg": "id_2.second_param [ second ]"
Add Comment
Please, Sign In to add comment