| In types that use the default ensurable logic, the "ensure" property works in implied ways when it is not present. This default behavior is described in our documentation's Type Reference page. However, this isn't always clear in the individual types' description of the ensure attribute. For example, If a user specifies this below entry in their manifest/site.pp, puppet will not CREATE a file. But if the file exists, puppet will MODIFY the file.
file { 'test entry friendly name' : |
path => '/tmp/testfile', |
content => 'a whole bunch of testy content.' |
}
|
But the file type documentation does not describe the behavior of omitting the attribute. This is further complicated by types that do not use the default ensurable logic, such as the group type prior to Puppet 5.4.0 (see PUP-7968). |