Open aboks opened 4 months ago
A resource declation like
apt::mark { 'foo': setting => unhold }
is not idempotent and will execute on every Puppet run.
I would expect this resource to be idempotent, so that it can be used to ensure that a certain package is not held.
Add an apt::mark resource as above for an installed package that is not held, and observe Puppet executing it on every run.
apt::mark
main
It seems that the unless_cmd for unhold is just not configured: https://github.com/puppetlabs/puppetlabs-apt/blob/22ed8ab5509d7f0f553f3dd4fab3c096c17214b0/manifests/mark.pp#L16 Something like ! (/usr/bin/apt-mark showhold ${title} | grep ${title} -q), or adding /usr/bin/apt-mark showhold ${title} | grep ${title} -q to onlyif, should probably work.
unless_cmd
unhold
! (/usr/bin/apt-mark showhold ${title} | grep ${title} -q)
/usr/bin/apt-mark showhold ${title} | grep ${title} -q
onlyif
Describe the Bug
A resource declation like
is not idempotent and will execute on every Puppet run.
Expected Behavior
I would expect this resource to be idempotent, so that it can be used to ensure that a certain package is not held.
Steps to Reproduce
Add an
apt::mark
resource as above for an installed package that is not held, and observe Puppet executing it on every run.Environment
main
)Additional Context
It seems that the
unless_cmd
forunhold
is just not configured: https://github.com/puppetlabs/puppetlabs-apt/blob/22ed8ab5509d7f0f553f3dd4fab3c096c17214b0/manifests/mark.pp#L16 Something like! (/usr/bin/apt-mark showhold ${title} | grep ${title} -q)
, or adding/usr/bin/apt-mark showhold ${title} | grep ${title} -q
toonlyif
, should probably work.