Windows: Can't create/update file in user's home directory using template

71 views
Skip to first unread message

Dirk Heinrichs

unread,
Mar 3, 2014, 8:56:26 AM3/3/14
to puppet...@googlegroups.com
Hi,

I've created a simple class for creating/updating a file in a user's home directory on Windows like so:

class put_file ($user = undef, $group = undef) {
  file { 'user_dir':
    path   => "C:/Users/${user}",
    ensure => directory,
    owner  => "${user}",
  }

  file { 'some_file':
    path    => "C:/Users/${user}/somefile",
    ensure  => file,
    content => template('put_file/somefile.erb'),
    owner   => "${user}",
    group   => "${group}",
    mode    => '0666',
    require => File['user_dir'],
  }
}

The home directory exists as the user has been logged in before. However, when I try to apply this class (via agent), I get the following error message:

Error: ReplaceFile(C:/Users/the_user/somefile, C:/Users/the_user/somefile20140303-1756-qjll80):  The system cannot find the file specified.

Any idea what's going wrong here? Both master and agent are running Puppet 3.4.2.

Thanks...

    Dirk
--

Dirk Heinrichs, Senior Systems Engineer, Engineering Solutions
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Tel: +49 2226 1596666 (Ansage) 1149
Email: d...@recommind.com
Skype: dirk.heinrichs.recommind
www.recommind.com

Rob Reynolds

unread,
Mar 4, 2014, 7:14:28 PM3/4/14
to puppet...@googlegroups.com
This appears to be PUP-1389[1]. We've fixed a found issue with Windows 2012 and ruby and how they handle the double line terminator. Note that the description is somewhat misleading, this can happen with any file name. We've fixed the issue, you will want to evaluate 3.4.3 to get it. This bug became more prominent once we applied a CVE fix for 3.4.1. 



--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/53148A0A.5020604%40recommind.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Rob Reynolds
Developer, Puppet Labs

Join us at PuppetConf 2014September 23-24 in San Francisco - http://bit.ly/pupconf14
Register now and save $350!

Dirk Heinrichs

unread,
Mar 5, 2014, 3:14:32 AM3/5/14
to puppet...@googlegroups.com
Am 05.03.2014 01:14, schrieb Rob Reynolds:

This appears to be PUP-1389[1]. We've fixed a found issue with Windows 2012 and ruby and how they handle the double line terminator. Note that the description is somewhat misleading, this can happen with any file name. We've fixed the issue, you will want to evaluate 3.4.3 to get it. This bug became more prominent once we applied a CVE fix for 3.4.1. 

Yes, updating to 3.4.3 fixes the problem.

The description of PUP-1389 was indeed misleading as I checked the release notes before posting to the list and found that none of the fixed issues seemed to apply to my problem. Thanks for pointing me into the right direction.

BTW: I had this problem on Windows Server 2008R2.

Bye...

Rob Reynolds

unread,
Mar 5, 2014, 12:45:01 PM3/5/14
to puppet...@googlegroups.com
Thanks, I updated the issue name to help some for future searching.


--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages