Documentation

    cronvar

    Manage variables in crontab files.

    Attributes

    check_mode:
      support: full
    

    Parameters

    Parameter Required Type Values Description
    name true string   Variable name (e.g., SHELL, PATH, MAILTO).
    value   string   Variable value. Required if state=present.
    state   string absent
    present
    Whether the variable should be present or absent. [default: "present"]
    user   string   The specific user whose crontab should be modified. Defaults to system crontab (/etc/crontab).

    Examples

    - cronvar:
        name: PATH
        value: /usr/local/bin:/usr/bin:/bin
    
    - cronvar:
        name: MAILTO
        value: admin@example.com
        user: root
    
    - cronvar:
        name: SHELL
        value: /bin/bash
    
    - cronvar:
        name: OLD_VAR
        state: absent