| Puppet Version: 6.18.0 Puppet Server Version: n/a (standalone) OS Name/Version: Ubuntu 18.04 With the manifest
file { "/foo": |
ensure => absent; |
}
|
and a directory already exists at /foo, puppet currently refuses to remove /foo because force is not true. I'm applying this manifest using
This issue concerns the generated report. Desired Behavior: The resulting report should be as if the manifest were
file { "/foo": |
ensure => directory; |
}
|
because without force => true the desired end state on the host is to keep the directory around. Example report output:
resource_statuses: |
File[/foo]: |
title: "/foo" |
file: "/etc/puppet/manifests/hello.pp" |
line: 1 |
resource: File[/foo] |
resource_type: File |
provider_used: posix |
containment_path: |
- Stage[main] |
- Main |
- File[/foo] |
evaluation_time: 0.000349 |
tags: |
- file |
- class |
time: '2020-10-06T17:19:02.736067500+00:00' |
failed: false |
failed_to_restart: false |
changed: false |
out_of_sync: false |
skipped: false |
change_count: 0 |
out_of_sync_count: 0 |
events: [] |
corrective_change: false
|
Actual Behavior: The report claims that the resource File[/foo] was out of sync and changed when no action has been taken:
resource_statuses: |
File[/foo]: |
title: "/foo" |
file: "/etc/puppet/manifests/hello.pp" |
line: 1 |
resource: File[/foo] |
resource_type: File |
provider_used: posix |
containment_path: |
- Stage[main] |
- Main |
- File[/foo] |
evaluation_time: 0.0007467 |
tags: |
- file |
- class |
time: '2020-10-06T17:19:55.896593800+00:00' |
failed: false |
failed_to_restart: false |
changed: true |
out_of_sync: true |
skipped: false |
change_count: 1 |
out_of_sync_count: 1 |
events: |
- audited: false |
property: ensure |
previous_value: directory |
desired_value: absent |
historical_value: |
message: removed |
name: file_removed |
status: success |
time: '2020-10-06T17:19:55.896801400+00:00' |
redacted: |
corrective_change: false |
corrective_change: false
|
This means that puppet will perpetually report the status as changed. |