main.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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-kubernetes
  32. state: latest
  33. #- name: Make sure stuff is in PATH
  34. # lineinfile:
  35. # path: "{{ ansible_facts['user_dir'] }}/.bashrc"
  36. # line: 'PATH="${PATH}:/opt/amq/bin"'
  37. # regexp: '^PATH=.*/opt/amq/bin'
  38. # insertafter: "^# User specific environment$"
  39. # state: present
  40. # loop:
  41. # - KAFKA_HOME
  42. - name: Verify cluster connectivity
  43. kubernetes.core.k8s_cluster_info:
  44. kubeconfig: tmp/kubeconfig-{{ item }}
  45. validate_certs: no
  46. loop: "{{ clusters }}"
  47. ...