voxpupuli / puppet-openvpn

OpenVPN module for puppet including client config/cert creation
Apache License 2.0
113 stars 198 forks source link

Predictable Interface Names on Debian 9 (stretch) not working #263

Open duckpuppy opened 6 years ago

duckpuppy commented 6 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Simply include the module and declare a server

What are you seeing

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown variable: '::ipaddress_eth0'. at /etc/puppetlabs/code/environments/production/modules/openvpn/manifests/server.pp:451:47 at /etc/puppetlabs/code/environments/production/manif ests/openvpn.pp:10 on node dagobah.pondnet

What behaviour did you expect instead

No error

Output log

Any additional information you'd like to impart

As of Debian 9, predictable interface names are used by default. That means that there's no eth0, etc. Instead, the interfaces are named by BIOS information. My primary interface is named eno1. In fact... facter reports an empty interfaces fact. There's no fact named ::ipaddress_eth0, but there is one named ipaddress.

duckpuppy commented 6 years ago

And after doing what I thought was a decent search of things, I found the local configuration option. That might benefit from being surfaced in the docs since predictable interface names are going to become more prevalent in various distros.

Rathios commented 4 years ago

This default is also an issue on RedHat/CentOS 7, which also uses the predictable interface naming scheme.

From openvpn::server:

 String $local = $facts['ipaddress_eth0'],

Which results in

Error while evaluating a Resource Statement, Openvpn::Server[servername]: parameter 'local' expects a String value, got Undef

A more sane default would be just $facts['ipaddress']