Bug #6727
"Could not find user" When Managing a File - But the New User Exists
| Status: | Closed | Start date: | 03/16/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% | ||
| Category: | API | |||
| Target version: | - | |||
| Affected Puppet version: | 0.25.5 | Branch: | ||
| Keywords: | ||||
Description
A basic user and file creation like this
$user_name = 'puppet_test'
$group_name = 'puppet_test'
@group { $group_name: }
@user { $user_name: }
realize Group[$group_name]
realize User[$user_name]
file { '/tmp/nothing':
owner => $user_name,
group => $group_name,
# ensure => file,
require => User[$user_name],
}
Results in the following error: err: //File[/tmp/nothing]: Failed to retrieve current state of resource: Could not find user puppet_test
Uncommenting the ensure line will cause it to work. Is this an error in my logic, the underlying logic of puppet, or just a display bug?
History
#1
Updated by Ben Hughes about 2 years ago
- Status changed from Unreviewed to Investigating
- Assignee set to Ben Hughes
What outcome are are you expecting? This is not realising things due to not specify what state you want them to be in.
$user_name = 'puppet_test'
$group_name = 'puppet_test'
@group { $group_name: ensure=> present }
@user { $user_name: ensure=> present, gid => $group_name }
realize Group[$group_name]
realize User[$user_name]
file { '/tmp/nothing':
owner => $user_name,
group => $group_name,
ensure => file,
require => User[$user_name],
}
Works fine.
#2
Updated by Devon Peters over 1 year ago
- Category set to API
- Status changed from Investigating to Closed
This behavior is expected.