main.yml 1.3 KB

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