Expression Functions

More functions will be added. keep in mind Recipe Runner is in a very early stage.


Returns the value of an environment variable.

    - register_variables:
        db_password: "{{env('db_password')}}"
    register: my_variables


  • name (string) The variable name

Return value

(string|null) Returns the value of the environment variable name, or null if variable name does not exist.


Compares two version strings following the pattern mayor.minor.patch. This function may be used for executing actions only if the version of PHP meets the constraint.

when: "version_compare(php_version, '>', '7.0.0')"


  • version1 (string)
  • operator (string) Operator. Valid values: <, <=, >, >=, =, !=.
  • version2 (string)

Return value

(bool) True if the relationship is the one specified by the operator, false otherwise.