puppetlabs/bolt

Bolt apply does not preserve symlinks in source directories

lollipopman opened this issue · 5 comments

Describe the Bug

Given a file resource with recurse true and a directory as the source:

file { /home/butter:
    ensure       => present,
    source       => "puppet:///modules/users/home/butter}/",
    recurse      => 'remote',
    mode         => '0644',
    owner        => 'butter',
    group        => 'butter',
    force        => true,
}

$ cd /home/butter
$ tree
.
├── foo -> bar
└── bar

Bolt fails to preserve the symlink, which generates the following erroneous change:

Notice: /Stage[main]/User[butter]/File[/home/butter/foo]/ensure: current_value 'link', should be 'file' (noop)

Expected Behavior

symlink is preserved, resulting in no changes

My guess is that when we tar up the module's files for the apply we loose the symlink

output.tar.add_file_simple(
\using Minitar. A quick glance through that library does not yield and obvious way to actually preserve the symlink when building the tar archive. If it is the case that this is the cause of this issue and that it is not an existing feature in minitar someone would probably have to land that feature in the minitar project for us to be able to make this work in bolt.

halostatue/minitar#8

op-ct commented

This issue has not had activity for 60 days and will be marked as stale.
If this issue continues to have no activity for 7 days, it will be closed.

This issue is stale and has been closed. If you believe this is in error,
or would like the Bolt team to reconsider it, please reopen the issue.

@op-ct Apologies for the delay. I should be able to merge the symlink support and release a new version by the new year.