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.

40 lines
1.3 KiB

  1. ---
  2. - name: "Kubernetes Apps | Check cluster settings for MetalLB"
  3. fail:
  4. msg: "MetalLB require kube_proxy_strict_arp = true, see https://github.com/danderson/metallb/issues/153#issuecomment-518651132"
  5. when:
  6. - "kube_proxy_mode == 'ipvs' and not kube_proxy_strict_arp"
  7. - name: Kubernetes Apps | Check AppArmor status
  8. command: which apparmor_parser
  9. register: apparmor_status
  10. when:
  11. - podsecuritypolicy_enabled
  12. - inventory_hostname == groups['kube-master'][0]
  13. failed_when: false
  14. - name: Kubernetes Apps | Set apparmor_enabled
  15. set_fact:
  16. apparmor_enabled: "{{ apparmor_status.rc == 0 }}"
  17. when:
  18. - podsecuritypolicy_enabled
  19. - inventory_hostname == groups['kube-master'][0]
  20. - name: "Kubernetes Apps | Lay Down MetalLB"
  21. become: true
  22. template: { src: "{{ item }}.j2", dest: "{{ kube_config_dir }}/{{ item }}" }
  23. with_items: ["metallb.yml", "metallb-config.yml"]
  24. register: "rendering"
  25. when:
  26. - "inventory_hostname == groups['kube-master'][0]"
  27. - name: "Kubernetes Apps | Install and configure MetalLB"
  28. kube:
  29. name: "MetalLB"
  30. kubectl: "{{ bin_dir }}/kubectl"
  31. filename: "{{ kube_config_dir }}/{{ item.item }}"
  32. state: "{{ item.changed | ternary('latest','present') }}"
  33. become: true
  34. with_items: "{{ rendering.results }}"
  35. when:
  36. - "inventory_hostname == groups['kube-master'][0]"