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

CiaB 7.0.1: bootstrap fails on traefik #261

Open
garloff opened this issue Apr 7, 2024 · 8 comments
Open

CiaB 7.0.1: bootstrap fails on traefik #261

garloff opened this issue Apr 7, 2024 · 8 comments

Comments

@garloff
Copy link
Contributor

garloff commented Apr 7, 2024

cd /opt/configuration/environments/manager
./run.sh traefik
[...]

TASK [osism.services.traefik : Create traefik external network] ************************************************************************
ok: [manager.systems.in-a-box.cloud]

TASK [osism.services.traefik : Copy docker-compose.yml file] ***************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.errors.AnsibleUndefinedVariable: {{ hostvars[inventory_hostname]['ansible_' + internal_interface]['ipv4']['address'] }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. {{ hostvars[inventory_hostname]['ansible_' + internal_interface]['ipv4']['address'] }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'
fatal: [manager.systems.in-a-box.cloud]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: {{ hostvars[inventory_hostname]['ansible_' + internal_interface]['ipv4']['address'] }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. {{ hostvars[inventory_hostname]['ansible_' + internal_interface]['ipv4']['address'] }}: 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'. 'ansible.vars.hostvars.HostVarsVars object' has no attribute 'ansible_vlan100'"}

PLAY RECAP *****************************************************************************************************************************
manager.systems.in-a-box.cloud : ok=8    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0   
@garloff
Copy link
Contributor Author

garloff commented Apr 7, 2024

Is something wrong with the network (netplan) config?
If I add ip link add link eno1np0 name vlan100 type vlan id 100; netplan apply, this script starts to work.

@garloff
Copy link
Contributor Author

garloff commented Apr 7, 2024

And ip link add link eno1np0 name vlan101 type vlan id 101 is needed as well. bootstrap.sh && deploy.sh then succeeds.

@garloff
Copy link
Contributor Author

garloff commented Apr 8, 2024

And this somehow needs to be persisted, so the system survives a reboot.

@garloff
Copy link
Contributor Author

garloff commented Apr 8, 2024

I wonder if this is a netplan bug. The settings in 01-osism.yaml look correct to me and according to the docs, I would have expected netplan to bring up these vlan ifaces.

@garloff
Copy link
Contributor Author

garloff commented Apr 8, 2024

I could not find a way how to tell netplan to bring up the vlan links, so I injected a custom systemd unit into the boot process. This is certainly not the intended way to do things.

dragon@manager:~$ cat /etc/rc.network 
#!/bin/bash
if test "$1" = "start" -o "$1" = "restart"; then
        ip link add link eno1np0 name vlan100 type vlan id 100
        ip link add link eno1np0 name vlan101 type vlan id 101
        netplan apply
fi
dragon@manager:~$ cat /etc/systemd/system/rc-network.service 
# SPDX-License-Identifier: LGPL-2.1-or-later
# Injected to work around missing vlan links in netplan
# (c) Kurt Garloff <[email protected]>, 4/2024
[Unit]
Description=/etc/rc.network setup
Documentation=man:systemd-rc-local-generator(8)
ConditionFileIsExecutable=/etc/rc.network
After=network-pre.target

[Service]
Type=forking
ExecStart=/etc/rc.network start
TimeoutSec=0
RemainAfterExit=yes
GuessMainPID=no

[Install]
WantedBy=multi-user.target

@berendt
Copy link
Member

berendt commented Apr 8, 2024

Please paste /etc/netplan/01-osism.yaml.

@berendt berendt transferred this issue from osism/issues Apr 8, 2024
@garloff
Copy link
Contributor Author

garloff commented Apr 8, 2024

Looks correct to me ...

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
---
network:
  version: 2
  renderer: networkd

  bonds:
    {}


  bridges:
    {}


  ethernets:
    eno1np0:
        dhcp4: true


  tunnels:
    {}


  vlans:
    vlan100:
        addresses:
        - 192.168.16.10/24
        id: 100
        link: eno1np0
    vlan101:
        id: 101
        link: eno1np0


  vrfs:
    {}

@berendt
Copy link
Member

berendt commented Jun 2, 2024

This was probably fixed with osism/ansible-collection-commons#637.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants