How to ensure that the «if» statement gets parsed _before_ a given resource/class?
It is a an answer using virtual resources, that lavaman
suggested.
I don't like the fact, that it forces me to put code with "VirtualBox" to the class, that I think should be logically independent to it. But I think it can be worked-around using delegated classes (like userdocs::virtualbox, defined completely elsewhere).
class userdocs ( $sourcetype) {
case $sourcetype {
'cryptpartition' : {
@file { "${userhome}/.VirtualBox": ensure=>link, ...
}
...
}
'partition' : {
@file { "${userhome}/.VirtualBox": ensure=>link, ...
}
...
}
'none' : {
@file { "${userhome}/.VirtualBox": ensure=>directory, ...
}
...
}
}
...
}
and
class vbox {
realize File["${userhome}/.VirtualBox"]
...
}