mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2025-12-25 18:23:05 +01:00
Small tweak to reduce delta from head Set calico option to be disabled by default Add rescue blocks in case updating existing Refactor items and update comments Refactor and consolidate calico.yml into block Refactor to use template for Calico CRs Revert use_calico to false Template blockSize Align default cidr in template with all.yml sample Apply upstream version tags Revert to current ver tags. Upstream's don't work. Update template address detection Add Tigera Operator/Calico CNI option
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
---
|
|
- name: Apply overrides
|
|
ansible.builtin.import_playbook: >-
|
|
{{ lookup("ansible.builtin.env", "MOLECULE_SCENARIO_DIRECTORY") }}/overrides.yml
|
|
|
|
- name: Configure dual-stack networking
|
|
hosts: all
|
|
become: true
|
|
|
|
# Unfortunately, as of 2022-09, Vagrant does not support the configuration
|
|
# of both IPv4 and IPv6 addresses for a single network adapter. So we have
|
|
# to configure that ourselves.
|
|
# Moreover, we have to explicitly enable IPv6 for the loopback interface.
|
|
|
|
tasks:
|
|
- name: Enable IPv6 for network interfaces
|
|
ansible.posix.sysctl:
|
|
name: net.ipv6.conf.{{ item }}.disable_ipv6
|
|
value: "0"
|
|
with_items:
|
|
- all
|
|
- default
|
|
- lo
|
|
|
|
- name: Disable duplicate address detection
|
|
# Duplicate address detection did repeatedly fail within the virtual
|
|
# network. But since this setup does not use SLAAC anyway, we can safely
|
|
# disable it.
|
|
ansible.posix.sysctl:
|
|
name: net.ipv6.conf.{{ item }}.accept_dad
|
|
value: "0"
|
|
with_items:
|
|
- "{{ container_iface }}"
|
|
|
|
- name: Write IPv4 configuration
|
|
ansible.builtin.template:
|
|
src: 55-flannel-ipv4.yaml.j2
|
|
dest: /etc/netplan/55-flannel-ipv4.yaml
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
register: netplan_template
|
|
|
|
- name: Apply netplan configuration
|
|
# Conceptually, this should be a handler rather than a task.
|
|
# However, we are currently not in a role context - creating
|
|
# one just for this seemed overkill.
|
|
when: netplan_template.changed
|
|
ansible.builtin.command:
|
|
cmd: netplan apply
|
|
changed_when: true
|