Skip to content
  • micah's avatar
    Fix fact for when shorewall is not yet installed. · 0cd2a305
    micah authored
    When a node has puppet run for the first time, shorewall may not be
    installed. In that case there are a few problems that appear in puppet4:
    
    1. Warning: Facter: Could not retrieve fact='shorewall_major_version', resolution='<anonymous>': undefined method `split' for nil:NilClass
    
    This is because running 'shorewall version' fails and so results in a
    nil, and the split cannot be done on a nil. That is solved by first
    running the 'shorewall version' and setting a variable. If that variable
    is not nil, then we can split off of that
    
    2. Error: Could not retrieve catalog from remote server: Error 500 on
    SERVER: Server Error: Evaluation Error: Error while evaluating a
    Resource Statement, Evaluation Error: Error while evaluating a Function
    Call, 'versioncmp' parameter 'a' expects a String value, got Undef
    
    This happens because the shorewall_version is set to Undef, but we need
    to have it set to a String. So we set the variable to '-1' if it is not
    installed.
    0cd2a305