For openSUSE Tumbleweed run the following as root:
zypper addrepo https://download.opensuse.org/repositories/spins:invis:15:stable:samba/openSUSE_Tumbleweed/spins:invis:15:stable:samba.repo
zypper refresh
zypper install flex
For openSUSE Leap 15.1 run the following as root:
zypper addrepo https://download.opensuse.org/repositories/spins:invis:15:stable:samba/openSUSE_Leap_15.1/spins:invis:15:stable:samba.repo
zypper refresh
zypper install flex
For 15.6 run the following as root:
zypper addrepo https://download.opensuse.org/repositories/spins:invis:15:stable:samba/15.6/spins:invis:15:stable:samba.repo
zypper refresh
zypper install flex
For 15.5 run the following as root:
zypper addrepo https://download.opensuse.org/repositories/spins:invis:15:stable:samba/15.5/spins:invis:15:stable:samba.repo
zypper refresh
zypper install flex
For 15.4 run the following as root:
zypper addrepo https://download.opensuse.org/repositories/spins:invis:15:stable:samba/15.4/spins:invis:15:stable:samba.repo
zypper refresh
zypper install flex