Puppet supports the concept of resource dependencies where one resource will not by synced until another is synced first. For example, the following Puppet fragment will create the user user1
and the group group1
but it will create the group first:
group { 'group1':
ensure => present
}
user { 'user1':
ensure => present,
gid => 'group1',
require => Group['group1']
}
My question is: how do dependencies work when the ensure
parameter is changed from "present" to "absent":
group { 'group1':
ensure => absent
}
user { 'user1':
ensure => absent,
gid => 'group1',
require => Group['group1']
}
What does Puppet do in a case like this? Does it remove the group first, or the user first? Or perhaps the order is not defined?
In general, how would you ensure that one resource is not present only when some other resource is already not present.