sous-chefs / openvpn

Development repository for the openvpn cookbook
https://supermarket.chef.io/cookbooks/openvpn
Apache License 2.0
98 stars 160 forks source link

Converge fails under Amazon Linux #178

Closed jgitlin-p21 closed 3 years ago

jgitlin-p21 commented 4 years ago

:ghost: Brief Description

When converging under Amazon Linux 2, the service fails to star because the systemd unit is not found

:pancakes: Cookbook version

v5.1.1

:woman_cook: Chef-Infra Version

Cinc Client: 16.5.64

:tophat: Platform details

Amazon Linux 2 with Amazon stock AMI

Steps To Reproduce

Create a Policyfile which includes "openvpn::server" in the run list and converge.

:police_car: Expected behavior

A working OpenVPN server in the cloud

:heavy_plus_sign: Additional context

OpenVPN service name is wrong and the converge fails with:

     * service[openvpn] action restart

       ================================================================================
       Error executing action `restart` on resource 'service[openvpn]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '5'
       ---- Begin output of ["/bin/systemctl", "--system", "restart", "openvpn"] ----
       STDOUT: 
       STDERR: Failed to restart openvpn.service: Unit not found.
       ---- End output of ["/bin/systemctl", "--system", "restart", "openvpn"] ----
       Ran ["/bin/systemctl", "--system", "restart", "openvpn"] returned 5

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/openvpn/recipes/service.rb

        58: service 'openvpn' do
        59:   service_name service_name
        60:   action [:enable, :start]
        61: end