Hi all, I’m wanting to create a Symlink “latest” (...
# puppet
p
Hi all, I’m wanting to create a Symlink “latest” (which links to the top level directory of an extracted TGZ). It seems to work, but I have an ordering problem. For the file resource, I’ve tried using a require (i.e. dependency) on the Archive resource, but what I’m finding is that Puppet tries to create the symlink before the archive has actually been extracted. My code is:
Copy code
archive { "/tmp/dspace-$dspace_version.tar.gz":
      source       => "<https://github.com/DSpace/DSpace/archive/refs/tags/dspace-$dspace_version.tar.gz>",
      extract      => true,
      extract_path => "$dspace_src",
      cleanup      => true,
      user         => 'tomcat',
      group        => 'tomcat',
      require      => File["$dspace_src"],
    }

    file { "$dspace_src/latest":
      ensure  => 'link',
      target  => "$dspace_src/$dspace_src_top_level_dir",
      require => Archive["/tmp/dspace-$dspace_version.tar.gz"],
    }