main.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ---
  2. # Variables affecting this role:
  3. #
  4. # clusters:
  5. # just a simple list of clusters to check
  6. #
  7. - name: Make sure kubeconfig is there on utility
  8. delegate_to: utility.lab.example.com
  9. file:
  10. path: /home/lab/{{ item }}/auth/kubeconfig
  11. state: file
  12. loop: "{{ clusters }}"
  13. - name: Create a temp dir
  14. file:
  15. path: tmp
  16. state: directory
  17. - name: Copy over the kubeconfig
  18. delegate_to: utility.lab.example.com
  19. fetch:
  20. src: /home/lab/{{ item }}/auth/kubeconfig
  21. dest: tmp/kubeconfig-{{ item }}
  22. flat: yes
  23. loop: "{{ clusters }}"
  24. - name: We need some packages to be there
  25. become: yes
  26. yum:
  27. name:
  28. - java-17-openjdk-headless
  29. - java-17-openjdk-devel
  30. - python3-jmespath
  31. - python3.11-jmespath
  32. - python3-kubernetes
  33. - ansible-collection-ansible-posix
  34. - ansible-collection-community-general
  35. state: latest
  36. #- name: Make sure stuff is in PATH
  37. # lineinfile:
  38. # path: "{{ ansible_facts['user_dir'] }}/.bashrc"
  39. # line: 'PATH="${PATH}:/opt/amq/bin"'
  40. # regexp: '^PATH=.*/opt/amq/bin'
  41. # insertafter: "^# User specific environment$"
  42. # state: present
  43. # loop:
  44. # - KAFKA_HOME
  45. - name: Verify cluster connectivity
  46. kubernetes.core.k8s_cluster_info:
  47. kubeconfig: tmp/kubeconfig-{{ item }}
  48. validate_certs: no
  49. loop: "{{ clusters }}"
  50. ...