conditional lines for custom repo files

We have this issue where custom repo files were being written without values, e.g.:

    [ceph repo]
    gpgcheck=
    
This changes the templating to accept arbitrary values (as a function) and adds lines if values are not `None` nor empty strings `''`