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

Autostart template #142

Closed
gingaz opened this issue Mar 6, 2015 · 4 comments
Closed

Autostart template #142

gingaz opened this issue Mar 6, 2015 · 4 comments

Comments

@gingaz
Copy link

gingaz commented Mar 6, 2015

Hi,

When I install openvpn server it fails to start. The cause is in the generated /etc/default/openvpn file [1].
More specifically:

  • Line 2 prevents openvpn from starting ("AUTOSTART="$AUTOSTART client1"").
    • If I modify the line to "AUTOSTART="client1"" it successfully starts the server.
  • Line 2 and the last line are duplicate parameter options "AUTOSTART".

System:

  • Puppet 3.7
  • parser=future
  • Ubuntu 14.04.1 LTS

I am not familiar with the module yet, therefore I can't suggest a fix.

Cheers,
Gin

[1] /etc/default/openvpn.

# This file is managed by Puppet. DO NOT EDIT.
AUTOSTART="$AUTOSTART client1"
# This is the configuration file for /etc/init.d/openvpn

#
# Start only these VPNs automatically via init script.
# Allowed values are "all", "none" or space separated list of
# names of the VPNs. If empty, "all" is assumed.
#
#AUTOSTART="all"
#AUTOSTART="none"
#AUTOSTART="home office"
#
# Refresh interval (in seconds) of default status files
# located in /var/run/openvpn.$NAME.status
# Defaults to 10, 0 disables status file generation
#
#STATUSREFRESH=10
#STATUSREFRESH=0
# Optional arguments to openvpn's command line
OPTARGS=""
AUTOSTART=""
@gingaz gingaz changed the title Error: dependency cycle Autostart template Mar 6, 2015
@luxflux
Copy link
Contributor

luxflux commented Mar 6, 2015

Hm, I did not notice this before...

If you change order => 01 to order => '01' on https://github.com/luxflux/puppet-openvpn/blob/master/manifests/config.pp#L45, does it work?

@gingaz
Copy link
Author

gingaz commented Mar 7, 2015

Thanks luxflux for the tip.

Indeed, this fix works nice. Although I still get a duplicate of AUTOSTART, now the service works out of the box!

# This file is managed by Puppet. DO NOT EDIT.
# This is the configuration file for /etc/init.d/openvpn

#
# Start only these VPNs automatically via init script.
# Allowed values are "all", "none" or space separated list of
# names of the VPNs. If empty, "all" is assumed.
#
#AUTOSTART="all"
#AUTOSTART="none"
#AUTOSTART="home office"
#
# Refresh interval (in seconds) of default status files
# located in /var/run/openvpn.$NAME.status
# Defaults to 10, 0 disables status file generation
#
#STATUSREFRESH=10
#STATUSREFRESH=0
# Optional arguments to openvpn's command line
OPTARGS=""
AUTOSTART=""
AUTOSTART="winterthur"

@luxflux
Copy link
Contributor

luxflux commented Mar 18, 2015

@gingaz good to hear!i
Regarding the issue of double assignment of AUTOSTART, it should be written like this:

AUTOSTART=""
AUTOSTART="$AUTOSTART  winterthur"
AUTOSTART="$AUTOSTART otherserver"
# ...

Your output does not like this (yep, cpt. Obvious), is this a formatting issue? Or is the file on your server really formatted like your output?

@gingaz
Copy link
Author

gingaz commented Apr 2, 2015

Sorry for the belated reply. The script now works as you specified.
Thanks!

@gingaz gingaz closed this as completed Apr 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants