You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.9 KiB

  1. ---
  2. - name: Kubernetes Apps | Check AppArmor status
  3. command: which apparmor_parser
  4. register: apparmor_status
  5. when:
  6. - inventory_hostname == groups['kube_control_plane'][0]
  7. failed_when: false
  8. - name: Kubernetes Apps | Set apparmor_enabled
  9. set_fact:
  10. apparmor_enabled: "{{ apparmor_status.rc == 0 }}"
  11. when:
  12. - inventory_hostname == groups['kube_control_plane'][0]
  13. - name: Kubernetes Apps | Netchecker Templates list
  14. set_fact:
  15. netchecker_templates:
  16. - {file: netchecker-ns.yml, type: ns, name: netchecker-namespace}
  17. - {file: netchecker-agent-sa.yml, type: sa, name: netchecker-agent}
  18. - {file: netchecker-agent-ds.yml, type: ds, name: netchecker-agent}
  19. - {file: netchecker-agent-hostnet-ds.yml, type: ds, name: netchecker-agent-hostnet}
  20. - {file: netchecker-server-sa.yml, type: sa, name: netchecker-server}
  21. - {file: netchecker-server-clusterrole.yml, type: clusterrole, name: netchecker-server}
  22. - {file: netchecker-server-clusterrolebinding.yml, type: clusterrolebinding, name: netchecker-server}
  23. - {file: netchecker-server-deployment.yml, type: deployment, name: netchecker-server}
  24. - {file: netchecker-server-svc.yml, type: svc, name: netchecker-service}
  25. - name: Kubernetes Apps | Lay Down Netchecker Template
  26. template:
  27. src: "{{ item.file }}.j2"
  28. dest: "{{ kube_config_dir }}/{{ item.file }}"
  29. mode: "0644"
  30. with_items: "{{ netchecker_templates }}"
  31. register: manifests
  32. when:
  33. - inventory_hostname == groups['kube_control_plane'][0]
  34. - name: Kubernetes Apps | Start Netchecker Resources
  35. kube:
  36. name: "{{ item.item.name }}"
  37. namespace: "{{ netcheck_namespace }}"
  38. kubectl: "{{ bin_dir }}/kubectl"
  39. resource: "{{ item.item.type }}"
  40. filename: "{{ kube_config_dir }}/{{ item.item.file }}"
  41. state: "latest"
  42. with_items: "{{ manifests.results }}"
  43. when: inventory_hostname == groups['kube_control_plane'][0] and not item is skipped