Use a dispatch table here.

```perl
use constant OS_SPECIFIC_METHODS => {
    EL7 => {
       ANACONDA => "anaconda_el7",
       PRE => "pre_el7",
        ...
    }
    EL6 => {...}
};

sub anaconda_el7 {
    my $tree = shift;
    if ($tree->{eula}) {
        print "eula --agreed\n";
    }
    ...
}

# In the Anaconda directives function
OS_SPECIFIC_METHODS->{$ANACONDA_VERSION}->{ANACONDA}->($tree)
    if OS_SPECIFIC_METHODS->{$ANACONDA_VERSION}->{ANACONDA};
```

or something like that. I'd really like to have all the os-dependent code as close as possible.