Ross Morrison
07/26/2023, 11:36 AMSlackbot
07/26/2023, 2:11 PMnate
07/26/2023, 2:44 PMconfine: :role::foo
confine: :role::barvchepkov
07/26/2023, 2:47 PMvchepkov
07/26/2023, 2:47 PMnate
07/26/2023, 2:50 PMcruelsmith
07/26/2023, 3:46 PMnil then you can use this
confine :networking do |f|
!f.nil?
end
The other examples will else always expect a fixed value.
For structured facts you can use this construct:
confine :os do |os|
os['name'] == 'CentOS'
endnate
07/26/2023, 3:47 PMSlackbot
07/26/2023, 5:01 PMSlackbot
07/26/2023, 5:22 PMbastelfreak
07/26/2023, 7:01 PMjms1
07/26/2023, 7:08 PMnatemccurdy
07/26/2023, 7:12 PMpuppet command that you could create yourself.
However, the Face API's are private and deprecated for public use: https://www.puppet.com/docs/puppet/5.5/deprecated_api.html#puppet-faces-is-a-private-apijms1
07/26/2023, 7:14 PMjms1
07/26/2023, 7:15 PMexec with refreshonly => true ... is there any way for puppet code to "send a notification" to this resource, other than declaring some other resource with notify => Exec['xxx'] ?jms1
07/26/2023, 7:16 PManchor type at one point, not sure if that's what i'm thinking ofnatemccurdy
07/26/2023, 7:16 PMTo specify that a resource must refresh when a related resource changes, create a notifying relationship with theorsubscribemetaparameters or the notification chaining arrow (notify).~>
jms1
07/26/2023, 7:17 PM~> operatornatemccurdy
07/26/2023, 7:17 PMexec could have subscribe => Something[foo].jms1
07/26/2023, 7:17 PMjms1
07/26/2023, 7:18 PMif blockjms1
07/26/2023, 7:18 PMNoop['x'] ~> Exec['x']natemccurdy
07/26/2023, 7:18 PMrefreshonly => true?jms1
07/26/2023, 7:19 PMif statement in the codejms1
07/26/2023, 7:20 PMif ( $condition ) {
noop { 'x' :
notify => Exec['x'] ,
}
}jms1
07/26/2023, 7:21 PMnoop resource which, when declared, doesn't have any real effect on the target server, other than triggering the exec.vchepkov
07/26/2023, 7:21 PMDr Bunsen Honeydew
07/26/2023, 7:21 PMipcrm-echo module at https://forge.puppet.com/ipcrm/echo?src=slack&channel=puppetvchepkov
07/26/2023, 7:22 PMnatemccurdy
07/26/2023, 7:24 PManchor resource is maybe more appropriate here... but also... I feel like there's a misunderstanding of compile-time vs. enforcement-time logic here.