matt
06/06/2022, 8:28 AMmatt
06/06/2022, 8:28 AMglee
06/06/2022, 8:30 AMmatt
06/06/2022, 8:34 AMmatt
06/06/2022, 9:04 AMglee
06/06/2022, 9:18 AMelsif
, plus the comparison operator should be ==
not =
ie: } elsif versioncmp ($::version, '1.9.11') == -1
matt
06/06/2022, 9:26 AMmatt
06/06/2022, 9:26 AMmatt
06/06/2022, 9:26 AMmatt
06/06/2022, 9:27 AMSlackbot
06/06/2022, 10:35 AMStefan Hristovski
06/06/2022, 10:35 AMStefan Hristovski
06/06/2022, 10:36 AMchadh
06/06/2022, 12:06 PMcreates
parameter works is that puppet checks for the existence of the argument of that parameter before running the command. If that file exists, nothing happens. So the expectation is that the command “creates” the file, and thus the existence of the file means that the command has already run and does not need to be run again.
In your example it appears that the file you are specifying to creates
has to already exist since it is referenced in the command. So what you have won’t work.vchepkov
06/06/2022, 12:09 PMvchepkov
06/06/2022, 12:10 PMSlackbot
06/06/2022, 2:14 PMMicah
06/06/2022, 2:16 PMvchepkov
06/06/2022, 2:16 PMvchepkov
06/06/2022, 2:17 PMunless $facts['Timezone'] == 'UTC' {
Micah
06/06/2022, 2:17 PMvchepkov
06/06/2022, 2:17 PMYorokobi
06/06/2022, 2:18 PMMicah
06/06/2022, 2:18 PMMicah
06/06/2022, 2:19 PMexec { 'set UTC time':
command => '/usr/bin/timedatectl set-timezone UTC',
unless => $facts['timezone'] == 'UTC'
}
vchepkov
06/06/2022, 2:20 PMvchepkov
06/06/2022, 2:21 PMvchepkov
06/06/2022, 2:21 PMfile { '/etc/localtime':
ensure => link,
target => "/usr/share/zoneinfo/${timezone}",
}
Micah
06/06/2022, 2:21 PMvchepkov
06/06/2022, 2:22 PM