Commit 1f270db8 authored by Adam Lewenberg's avatar Adam Lewenberg
Browse files

use ln --force in case there is already a file at the destination

parent f1090082
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -60,8 +60,10 @@ define su_apache::cert::lets_encrypt (
  $onlyif_cmd_so = "sh -c \"test ! -f ${le_cert} || test ! -f ${le_key}\""

  # This is the command that does the linking.
  $cmd1_so     = "ln -s ${so_key} ${main_key}"
  $cmd2_so     = "ln -s ${so_cert} ${main_cert}"
  # We pass ln the --force option to overwrite any file that
  # may already be there.
  $cmd1_so     = "ln -s --force ${so_key} ${main_key}"
  $cmd2_so     = "ln -s --force ${so_cert} ${main_cert}"
  $link_cmd_so = "${cmd1_so} && ${cmd2_so}"

  exec { "link-${name}-to-so":
@@ -79,8 +81,10 @@ define su_apache::cert::lets_encrypt (
  $onlyif_cmd_le = "sh -c \"test -f ${le_cert} && test -f ${le_key}\""

  # This is the command that does the linking.
  $cmd1_le     = "ln -s ${le_key} ${main_key}"
  $cmd2_le     = "ln -s ${le_cert} ${main_cert}"
  # We pass ln the --force option to overwrite any file that
  # may already be there.
  $cmd1_le     = "ln -s --force ${le_key} ${main_key}"
  $cmd2_le     = "ln -s --force ${le_cert} ${main_cert}"
  $link_cmd_le = "${cmd1_le} && ${cmd2_le}"

  exec { "link-${name}-to-le":