main.yml 1.3 KB

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