federate-clusters.yml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. - name: Make sure all secured clusters are federated
  3. hosts: workstation.lab.example.com
  4. gather_subset: min
  5. become: no
  6. vars:
  7. clusters:
  8. ocp4:
  9. name: rhacs-cluster
  10. namespace: rhacs
  11. method: operator
  12. admission_instances: 3
  13. sno1:
  14. name: sno1
  15. namespace: stackrox
  16. method: roxctl
  17. admission_instances: 1
  18. k3s:
  19. name: k3s
  20. namespace: stackrox
  21. method: helm
  22. admission_instances: 1
  23. pull_user: '|uhc-pool-9f005376-36a2-42a1-a540-0473dc873633'
  24. pull_pass: 'eyJhbGciOiJSUzUxMiJ9.eyJzdWIiOiI5ODg5YWExYzBmOWI0ZjU3Yjk3NmI5ZWEyMzIwZjU0MCJ9.sZd9TMQo0WDG65G9BMNnknbPcFB36hrDXd18_u3KxqZs7e8maC_PxAQxjpuY4aS6TDHnLC5jFb4Q5qXTJVn2B8a8p1ncO-3n2HnPt876i-UACSyeukioy8hr4WwufHQxUX2lqXXXv3znQ7jmTECAsnkZCQHU5tSiFsTdxEdfdyN6gm17ujckadnMlPYq6_SR6mKKiJTtT7HYCYrAVNsgK_4adgc-EpelKGlcDEi34hXo1jlB3DDrQi1ILBWE0fGWoW3g-YS1F0YD_74nmWINfPMc3nT8DZAit8L4VQONvgPNubu_MUFPhj_oUR1wUDtkPQ6KIvo6Qf2FGp2wK3PzbtADQsEVSd9HO47kDJtahnOya1fFgjeY5lSq-moOdjRWBgu6_3H_nedLIGYPDtAfzypbuxvupGu3hXZusyctiDmGm7JDyEnJv1uDVfaWnSa3I_MpTRUW2ee5D_Bjrey7eSb4lJFrjux-gcbUhqlXbYsizk7WXzoFkkTYLuqCCQoKRt8WR7U3Nhwst6rEwxANibENSsQPw0h8_CCFnjLqRN_6qjSsKiydFOkGTYbOKZNKZIUabFEN4aaTUbiXMWOKa2jMq-Hpk0L4J0RkN3bdAUjZkDDq4dV5eQcusHy_KcogwUJJ6x03Nns8oLAv4IgtJyyqra5aBGJLQxscEuR740Y'
  25. tasks:
  26. - name: find api endpoint
  27. stat:
  28. path: "{{ ansible_facts['user_dir'] }}/api-endpoint"
  29. register: api_endpoint_is_there
  30. - assert:
  31. that: api_endpoint_is_there.stat.exists
  32. fail_msg: "ERROR: api-endpoint file not found. This usually means prerequisites (such as central deployment) are not met."
  33. success_msg: "OK: api-endpoint found."
  34. - name: load api endpoint
  35. set_fact:
  36. api_ep: "{{ lookup('file', ansible_facts['user_dir'] + '/api-endpoint') }}"
  37. - name: find api token
  38. stat:
  39. path: "{{ ansible_facts['user_dir'] }}/api-token"
  40. register: api_token_is_there
  41. - assert:
  42. that: api_token_is_there.stat.exists
  43. fail_msg: "ERROR: api-token file not found. This usually means prerequisites (such as central deployment) are not met."
  44. success_msg: "OK: api-token found."
  45. - name: load api token
  46. set_fact:
  47. api_token: "{{ lookup('file', ansible_facts['user_dir'] + '/api-token') }}"
  48. - include_role:
  49. name: federate-clusters
  50. tags: federate
  51. loop: "{{ clusters.keys() | list }}"
  52. loop_control:
  53. loop_var: cluster
  54. ...