Puppet: System Administration Automated

Support

Ticket #962 (new enhancement)

Opened 9 months ago

Last modified 8 months ago

Addition of value testing and logical/comparison operators

Reported by: jamtur01 Assigned to: luke
Priority: normal Milestone:
Component: language Version:
Severity: normal Keywords: if else conditional logical comparison operator
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description

It would be very useful to be able to test values and use logical operators in Puppet - particularly as an enhancement of conditionals. For example:

if $variable = "value" { action }
if $variable != "value" { action }
if $variable = "value" AND $variable2 = "value2" { action }
if $variable = "value" OR $variable2 = "value2" { action }

etc...

There are obviously other potential uses but the extension of the if/else capability would be very useful.

Change History

12/15/07 02:11:37 changed by jamtur01

  • keywords changed from if else conditional logical operator to if else conditional logical comparison operator.
  • summary changed from Addition of value testing and logical operators to Addition of value testing and logical/comparison operators.

12/30/07 11:47:26 changed by jamtur01

  • owner changed from community to luke.
  • stage changed from Unreviewed to Needs design decision.

01/19/08 20:56:12 changed by luke

  • stage changed from Needs design decision to Accepted.

I'd accept this patch (although not with the capital AND and OR, and I'd expect '==' as the comparison operator, rather than '=').

01/19/08 23:36:04 changed by jamtur01

Yes - that was my crude operator examples - I'd use the default Ruby operators I suspect, i.e. ==.