puppet-openvpn icon indicating copy to clipboard operation
puppet-openvpn copied to clipboard

Create server and export client in one step

Open barrypitman opened this issue 6 years ago • 0 comments

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10.8
  • Ruby: 2.0.0p648
  • Distribution: Red Hat 7.4
  • Module version: 7.1.0

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

# https://github.com/voxpupuli/puppet-openvpn
openvpn::servers:
    'server_name':
        country: 'ZA'
        province: 'GP'
        city: 'Pretoria'
        organization: 'google.com'
        email: '[email protected]'
        server: '10.200.200.0 255.255.255.0'

openvpn::client_defaults:
    server: 'server_name'

openvpn::clients:
    'client_name': {}

openvpn::deploy::export:
        client_name:
            server: 'server_name'

What are you seeing

I can't run the above on a new server. If I do, I get the following error:

Evaluation Error: Operator '[]' is not applicable to an Undef Value. at /etc/puppetlabs/code/environments/openvpn/modules/openvpn/manifests/deploy/export.pp:38:8

It seems that there is an error creating a new server and exporting a client in one step/run. If I comment out the export, and create the server and clients first, then uncomment the export, it works as expected.

What behaviour did you expect instead

I'd like to be able to create & export in one step

Output log

Any additional information you'd like to impart

barrypitman avatar Mar 16 '18 12:03 barrypitman