Jira (PUP-10019) file resource checks source even if the file exists and replace is false

9 views
Skip to first unread message

Thomas Kishel (JIRA)

unread,
Sep 13, 2019, 2:43:03 PM9/13/19
to puppe...@googlegroups.com
Thomas Kishel created an issue
 
Puppet / Bug PUP-10019
file resource checks source even if the file exists and replace is false
Issue Type: Bug Bug
Affects Versions: PUP 6.4.3
Assignee: Unassigned
Created: 2019/09/13 11:42 AM
Priority: Minor Minor
Reporter: Thomas Kishel

Puppet Version: 6.4.3 and presumably others
Puppet Server Version: NA
OS Name/Version: NA

Desired Behavior:

Skip the use of source if the file exists and replace is false.

Actual Behavior:

[root@pe-201911-master-ha ~]# cat a.pp 
file { '/tmp/test.txt':
  ensure => present,
  replace => false,
  source => "/tmp/source.txt",
}
 
[root@pe-201911-master-ha ~]# touch /tmp/test.txt
 
[root@pe-201911-master-ha ~]# puppet apply a.pp
Notice: Compiled catalog for pe-201911-master-ha.puppetdebug.vlan in environment production in 0.07 seconds
Error: /Stage[main]/Main/File[/tmp/test.txt]: Could not evaluate: Could not retrieve information from environment production source(s) file:///tmp/source.txt
Notice: Applied catalog in 0.19 seconds 

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Josh Cooper (JIRA)

unread,
Sep 16, 2019, 1:17:03 PM9/16/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10019
 
Re: file resource checks source even if the file exists and replace is false

The file type docs say:

Note that this only affects content; Puppet will still manage ownership and permissions.

Which means puppet still needs to retrieve the owner/group/mode from the source.

Josh Cooper (JIRA)

unread,
Sep 25, 2019, 1:58:03 PM9/25/19
to puppe...@googlegroups.com

Josh Cooper (JIRA)

unread,
Oct 1, 2019, 2:02:03 PM10/1/19
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10019
 
Re: file resource checks source even if the file exists and replace is false

This behavior is expected if puppet is managing permissions (so it needs to query the remote source to determine what the correct permissions should be). However, if you set source_permissions => ignore or if you explicitly specify the owner, group, mode, then I would not expect puppet to require the source to exist.

Josh Cooper (Jira)

unread,
Jun 11, 2020, 2:47:03 AM6/11/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Epic Link: PUP-7548
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages