Linux – Puppet changing source file permissions

linuxpermissionspuppetpuppet-agent

I'm setting up jail shells using puppet to maintain a copy of the required libraries within the jails.

Using the following puppet code I can successfully copy the files across:

file { "/home/${username}/lib/x86_64-linux-gnu/libdl.so.2":
        ensure => present,
        source => "/lib/x86_64-linux-gnu/libdl.so.2",
        mode => '0700',
        links => 'manage',
        owner => $username,
        group => $username,
        require => File["/home/${username}/lib/x86_64-linux-gnu/"]
}

It appears though that the source file permissions are being changed to $username:$username as well as the destination file permissions.

The file /lib/x86_64-linux-gnu/libdl.so.2 end's up with the following permissions:

-rwx------ 1 $username $username ld-2.19.so

The jailed users are obviously able to login with this setup, but for everyone else that would be using /bin/bash in the real /lib folder it is breaking the login.

Best Answer

You have to quote:

owner => '$username',