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

Doesn't work properly with "remote" in openvpn::server #252

Closed
cjeanneret opened this issue Nov 20, 2017 · 3 comments
Closed

Doesn't work properly with "remote" in openvpn::server #252

cjeanneret opened this issue Nov 20, 2017 · 3 comments
Labels
bug Something isn't working

Comments

@cjeanneret
Copy link
Contributor

Hello,

While using latest release (5.0.0), I have the following issue:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Openvpn::Ca[lsn]' for relationship on 'Service[openvpn@lsn]' on node ip-192-168-4-8.sandbox.internal

The receipt raising this issue is:

  sysctl {'net.ipv4.ip_forward':
    value => 1,
  }
  -> class {'::openvpn': }
  -> file {
    '/etc/openvpn/ssl/lsn/keys/ca.crt':
      content => file('c2c_ssl/freeipa/ca.crt');
    '/etc/openvpn/ssl/lsn/keys/lsn.key':
      content => file("openstack/ssl/${project}.key");
    '/etc/openvpn/ssl/lsn/keys/lsn.crt':
      content => file("openstack/ssl/${project}.crt");
  }
  -> ::openvpn::server {'lsn':
    remote => ['foo.bar'],
  }

After checking the openvpn::server definition, I think the main issue is with the different parts that add the Openvpn::Ca[...] as a prerequisite of the Service['openvpn@name'], for example this one will not match the fact that we're actually using a remote:

  if $::openvpn::params::systemd {
    if $::openvpn::manage_service {
      service { "openvpn@${name}":
        ensure   => running,
        enable   => true,
        provider => 'systemd',
        require  => File["${etc_directory}/openvpn/${name}.conf"],
      }
      if !$extca_enabled {
        Openvpn::Ca[$ca_name] -> Service["openvpn@${name}"]
      }
    }
  }

source

As the ::openvpn::ca isn't called at all if $remote is non-null, that param should also be tested in order to add or not the prerequisite.

Thank you!

Cheers,

C.

@juniorsysadmin juniorsysadmin added the bug Something isn't working label Nov 20, 2017
@cjeanneret
Copy link
Contributor Author

Had to modify the unit test in order to "prove" the issue - now the PR #253 is being checked on the CI :).

Lemme know if I need to do anything else on that matter. Locally, the rspec is all green.

@cjeanneret
Copy link
Contributor Author

@juniorsysadmin or @bastelfreak or anyone in the team, care to merge the #253 and, maybe, do some release we can reach on the Forge this week? :) That would be really nice.

@cjeanneret
Copy link
Contributor Author

merged in master - thanks @bastelfreak !

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

2 participants