Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: ansible_default_ipv4 fact & IPv6 only machine #134

Open
nicostrebel opened this issue Feb 21, 2023 · 0 comments
Open

bug: ansible_default_ipv4 fact & IPv6 only machine #134

nicostrebel opened this issue Feb 21, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@nicostrebel
Copy link

nicostrebel commented Feb 21, 2023

Summary

Inside /templates/keepalived.conf.j2 the Ansible fact "ansible_default_ipv4" is used three times.
If you want to run an IPv6 / Hybrid cluster which has an IPv6 main-address you will run in either of those two problems:

When no IPv4 interface is configured:
The execution fails with a fatal error and Ansible will stop the provisioning.

When both IPv4 and IPv6 interfaces are configured:
It will setup the keepalived VRRP on the wrong interface.

I for myself have just changed all occurrence of "ansible_default_ipv4" to "ansible_default_ipv6" for a workaround.

If it is possible it would be nice if you can integrate a check which evaluates if provided node ip/s are IPv4 or IPv6 and then based on the check later call the corresponding Ansible fact. An even easier workaround would be to use a role variable to enable IPv6.

Issue Type

Bug Report

Ansible Version

ansible [core 2.14.2]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/anon/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/anon/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.9 (main, Dec 19 2022, 17:35:49) [GCC 12.2.0] (/usr/bin/python)
  jinja version = 3.1.2
  libyaml = True

Steps to Reproduce

Inventory:
[masters]
rancher-server01 ansible_host=[IPv6-Address] rke2_type=server
rancher-server02 ansible_host=[IPv6-Address] rke2_type=server
rancher-server03 ansible_host=[IPv6-Address] rke2_type=server

[workers]
rancher-node01 ansible_host=[IPv6-Address] rke2_type=agent
rancher-node02 ansible_host=[IPv6-Address] rke2_type=agent
rancher-node03 ansible_host=[IPv6-Address] rke2_type=agent

[k8s_cluster:children]
masters
workers

Playbook:

  • name: Deploy RKE2
    hosts: all
    become: yes
    become_user: root
    become_method: su
    vars:
    rke2_ha_mode: true
    rke2_api_ip : [IPv6-Address]
    rke2_server_options:
    - "cluster-cidr: 2001:cafe:42:0::/56"
    - "service-cidr: 2001:cafe:42:1::/112"
    rke2_custom_registry_mirrors:
    - name: docker.io
    endpoint:
    - "https://registry.ipv6.docker.com"
    roles:
    • role: lablabs.rke2

Expected Results

Provisioning will run through all steps as usual and will bind keepalived VRRP on IPv6 Interface.

Actual Results

Provisioning fails at keepalived VRRP if no IPv4 is setup or will use wrong interface in an IPv4/IPv6 hybrid setup.
@nicostrebel nicostrebel added the bug Something isn't working label Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant