0

The following code does not work:

case $operatingsystemmajrelease  {
  '6': { $TOUCH = "/bin/touch"}
  '7': { $TOUCH = "/usr/bin/touch"}
}

I also tried:

case $operatingsystemmajrelease {
"6": { $TOUCH='/bin/touch' }
"7": { $TOUCH='/usr/bin/touch' }
default: { fail('Operatingsystemmajrelease case default triggered.')}
}

I am basically trying to assign a value to a variable based on the CentOS major release.

Felix Frank
  • 8,125
  • 1
  • 23
  • 30
user5191140
  • 61
  • 1
  • 1
  • 5
  • What is your Puppet version and how is it failing? – Felix Frank Aug 05 '15 at 09:03
  • It is the latest puppet version. It is failing because on a CentOS 6 agent I get the message: /usr/bin/touch not found – user5191140 Aug 05 '15 at 12:23
  • You might wish to try unquoted numbers. In Puppet 4, things are not strings by default anymore. The fact that the `'7'` case is invariably hit, however, suggests that Facter might actually report that wrong. Have you checked locally? (E.g. `puppet facts | grep operatingsystemmajrelease`.) Is the agent's `$certname` not unique perhaps? – Felix Frank Aug 05 '15 at 12:26

0 Answers0