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.

20 lines
768 B

  1. ---
  2. # TODO: Figure out why kubeadm does not fix this
  3. - name: Set etcd-servers fact
  4. set_fact:
  5. # noqa: jinja[spacing]
  6. etcd_servers: >-
  7. {% for host in groups['etcd'] -%}
  8. {% if not loop.last -%}
  9. https://{{ hostvars[host].access_ip | default(hostvars[host].ip | default(hostvars[host].ansible_default_ipv4['address'])) }}:2379,
  10. {%- endif -%}
  11. {%- if loop.last -%}
  12. https://{{ hostvars[host].access_ip | default(hostvars[host].ip | default(hostvars[host].ansible_default_ipv4['address'])) }}:2379
  13. {%- endif -%}
  14. {%- endfor -%}
  15. - name: Update apiserver etcd-servers list
  16. replace:
  17. path: /etc/kubernetes/manifests/kube-apiserver.yaml
  18. regexp: "(etcd-servers=).*"
  19. replace: "\\1{{ etcd_servers }}"